UBT ERROR: Failed to produce item

When compiling the source gives an error

UnrealBuildTool : error : UBT ERROR: Failed to produce item: D:\UnrealEngine-4.21\UnrealEngine-4.21\Engine\Intermediate\Build\Win64\UE4Editor\Development\MovieSceneTools\UE4Editor-MovieSceneTools.lib

Was having the same issue earlier today (same error), and got it working. 2 things i did, not sure which one was the fix, but i had visual studio 2019 installed, which i uninstalled. I also re-downloaded the source code. Then i got no errors on the engine build. Hope this helps.