Build errors with newest head from ue5-main branch on Windows/VS2022 and WITH_EDITORONLY_DATA and WITH_EDITOR defines

I pulled the latest ue5-main branch yesterday, cleared all old files and did a fresh rebuild following the steps from here, including running Setup.bat and GenerateProjectFiles.bat.

When building the target Development Editor for Win64 the compiler complains about identifiers not found, f.e. this one which is [not always] declared here.

It seems like there’s a mismatch with WITH_EDITORONLY_DATA and WITH_EDITOR, even though WITH_EDITORONLY_DATA is defined here and WITH_EDITOR is defined in UnrealEngine5\Engine\Intermediate\Build\Win64\x64\UnrealEditor\Development\Engine\SharedDefinitions.Engine.ShadowErrors.h as #define WITH_EDITOR 1 and both are defined as 1, according to the IDE highlighting at least.

I don’t know enough about the build system to figure where the problem comes from but i guess somehow UnrealEngine5\Engine\Intermediate\Build\Win64\x64\UnrealEditor\Development\Engine\SharedDefinitions.Engine.ShadowErrors.h isn’t included at the right time or at all or the build system doesn’t define or set WITH_EDITOR.

What could be the problem?