ERROR: Game targets are not currently supported from this engine distribution

I’m trying to compile some plugins which require runtime module, but I have to work with a custom build of Unreal Engine for “reasons”. This build was made using the Build Graph, it has the debug symbols stripped off and some templates removed to make the engine size more compact but it’s mostly a vanilla 5.0.3. When I try to compile the plugin using this build, I’m getting the following error:

BuildException: Game targets are not currently supported from this engine distribution.
   at UnrealBuildTool.UEBuildTarget.Create(TargetDescriptor Descriptor, Boolean bSkipRulesCompile, Boolean bForceRulesCompile, Boolean bUsePrecompiled)
   at UnrealBuildTool.BuildMode.CreateMakefile(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet)
   at UnrealBuildTool.BuildMode.Build(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, Boolean bSkipPreBuildTargets)
   at UnrealBuildTool.BuildMode.Execute(CommandLineArguments Arguments)
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray)

The UnrealEditor part compiles fine, UnrealGame target appears to be missing. Any clues on why the game target is missing?

Same problem. Do you have a solution?