Not sure if this will help but here is a link
Also, I have this in my target.cs files for 5.2.1 (I didn’t change it to .Unreal5_2 when I upgraded and it still compiles)
// Latest will always use the current engine version (may cause compile errors)
// IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
// Unreal5_0 = 5.0, Unreal5_1 = 5.1 and so on, may need to use an earlier version for backward-compatible include order
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_1;
So either delete the lines like the link suggests or make sure the IncludeOrderVersion is set to the correct version.