Build issue: The command Build.bat exited with code 6.

I’m trying to build UE4.27 with Visual Studio 2022 but I keep getting the error The command "..\..\Build\BatchFiles\Build.bat -Target="UE4Editor Win64 Development" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 6.

I’ve tried on multiple machines with no avail. Does anyone know what even causes this?

Thanks

Followup, I tried building the whole solution and I get these too