Could you try this:
Create a new blank project, open up your current project by clicking on the .uproject file, migrate your assets to the blank project, replace the Public & Private folders in the blank project’s Source folder with the ones in your current project, and build your project via the new project’s .sln file?
You can migrate your desired assets by right clicking on them, navigating to the Asset Actions section on the menu that pops up, and selecting the Migrate option. You can also right click on a folder to migrate the assets inside as a whole!
If that doesn’t work out, I also found this post, check it out: The type or namespace name "UnrealBuildTool" could not be found - #6 by 3dRaven
Hope these help!