Reproduction steps:
1. Open the attached "BugRepro" project
2. Open the "Assets/Scenes/SampleScene.unity" scene
3. Click File > Build Settings... > Build
Expected results: The project is successfully built
Actual results: The project building proccess stops with the "CommandInvokationFailure: Gradle build failed. " error
Reproduced with: 2020.3.46f1, 2021.3.21f1, 2022.2.12f1, 2023.1.0b9, 2023.2.0a7
Reproduced on: Windows 11 Pro 22H2