Global Mode manager build error

This error occurs when building:

Assertion failed: !IsRunningCommandlet() [File:D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdGlobals.cpp] [Line: 51]
The global mode manager should not be created or accessed in a commandlet environment. Check that your mode or module is not accessing the global mode tools or that scriptable features of modes have been moved to subsystems.

This is the main error we are getting but we seem to be unable to pin point the issue and there seems to be nobody else getting the issue either (of course this probably isn’t the case)

Issue was solved by deleting the project and then re-downloading it from github. Not sure why this method solved it, im guessing it reset some dodgy engine files.