Change default UE5 behavior, so that it loads C++ scripts

was the project started as Blueprint or C++?

is this project under Source/Revision control?

if it was created as Blueprint and then C++ was added later, then @Kehel18 suggestion should probably fix this behavior (if the project is under Source/Revision Control then you may need to check the permissions on the /DerivedDataCache and /Binaries as these should be folders related to turning your C++ code files into what the Editor Understands and uses

(if you are going to remove folders to fix this then leave /Content, /Source, ( maybe /config if you have done a bunch of work in Project Settings) and the [projectName].uproject
Right click the [projectName].uproject and select “Generate [Visual Studio] project files”
open the resulting [projectName].sln allow it to parse
Build and Run
when the editor comes up it should work by just opening the uproject since the last Build+Run from your IDE.