I had same problem. I installed .NET 8 after uninstalling .NET6 from visual studio installer. And I disabled read only option of "UE_5.4\Engine\Source" Directory. Then Unreal project build is works well. Additionally, my full path of UE is "C:\Program Files\Epic Games\UE_5.4\Engine\Source". Hope this works well with you.