Memory Profiler 2 immediately crashes itself on start

Yes. Your module’s Target.cs doesn’t apply to everything else. The UnrealBuildTool’s TargetRules.cs does apply to everything built by UBT (including the enigne, any modules, and game projects).