Failed to compile plugin source code.

Was having this same issue randomly, despite early engine versions previously working when using the plugin creator wizard, but now all engines were failing. Creating a new blank C++ project also couldn’t be created with a similar issue about an unknown file not being found:

The system cannot find the file specified.

Checked the .NET version and deleted the Binaries folder as well as all other generated folders in the project and engine, and rebuild UnrealBuildTool manually in Visual Studio. Nothing helped. The fix was to audit the PATH environment variable and remove or alter any invalid paths like:

C:\Users<YourUsername>.local\bin

The <YourUsername> had to be replaced with the actual username, or the path completely deleted as there were also many duplicates.