In a C++ project, are the code files under "Engine/UE5..." supposed to have no headers included and be full of errors?

These red squiggly lines happen a lot with UE with engine files, and if you don’t have compilation errors, just ignore them. Sometimes it helps to go to the engine and click Tools → Refresh Code.