Access Denied error on windows checking out main branch, but no on other branch

I have a strange problem with the QtWebEngine project here. When I checkout version 5.15.4 I can start qmake and it runs its configuration task. If however I checkout the main dev branch, I get an “Access Denied” under windows.

I use the command file below called with “get” argument for checkout, and make argument to run make. I have additionally tried to run make manually in the build directory as well as in the download directory which is always created new and with same name. I have also tried to set Everyone to full control while myself I already have Full control. Thisall did not change anything.

I cannot see how this could be a make or project problem, so I head for this place in seek of help. I have no clue how I could get this to work.

Additionally I have tried to switch off my virus and randsomware protections, run in administrative mode, reboot between “get” and “qmake”, checked with Sysinternals “handle.exe” that nothing is open. The strange thing is that I could also not see any access denied in process monitor.

I did also remove the “git checkout” from the command file for downloading the “dev” branch as cloning does default to that branch

And finally running QMAKE with debug:

E:\WORK\QT\Kits\build>c:\qt\6.1.0\msvc2019_64\bin\qmake.exe -d -d -d -d -d -d -d -d -d ../qtwebengine/ -- -webengine-proprietary-codecs
DEBUG 1: Resetting dir to: E:\WORK\QT\Kits\build
DEBUG 1: Changing dir to: ..
Cannot read E:/WORK/QT/Kits/qtwebengine: Access is denied.
Error processing project file: ..\qtwebengine\

rem SET VER=5.15.4
SET VER=dev
SET QTVER=6.1.0
SET MASTER=dev

IF X%1==X GOTO USAGE
GOTO %1

:USAGE
ECHO "usage: qtwebengine get|unpack|qmake"
GOTO EOF

:get
IF EXIST .\qtwebengine (
  cd qtwebengine
  IF EXIST ..\qtwebengine del /S /Q .
  IF EXIST ..\qtwebengine rmdir /S /Q .
  cd ..
  rd /S /Q qtwebengine
  )
IF EXIST .\qtwebengine GOTO EOF


git clone https://code.qt.io/qt/qtwebengine.git
cd qtwebengine 
git checkout %VER% 
git submodule update --init --recursive
cd ..

del qtwebengine.%VER%.7z
"c:\Program Files\7-Zip\7z.exe" a qtwebengine.%VER%.7z qtwebengine qtwebengine.cmd SetupQTBuildEnvironment.cmd
GOTO EOF

:qmake
IF EXIST .\build (
  cd build 
  IF EXIST ..\build del /S /Q .
  IF EXIST ..\build rmdir /S /Q .
  cd ..
  rd /S /Q build
  )
  
IF EXIST .\build GOTO EOF
mkdir build
cd build 
c:\qt\%QTVER%\msvc2019_64\bin\qmake.exe ../qtwebengine/ -- -webengine-proprietary-codecs
cd ..
GOTO EOF

:unzip
"c:\Program Files\7-Zip\7z.exe" x qtwebengine.%VER%.7z 
GOTO EOF

:EOF