K2Node_MacroInstance in ExpandNode

I’m attempting to spawn a macro intermediate node in the ExpandNode method of a custom UK2Node of mine. This is a snippet of how the macro node is being created:

UPackage* StandardMacrosPackage = FindObjectChecked<UPackage>(
nullptr, TEXT("/Engine/EditorBlueprintResources/StandardMacros"));
UBlueprint* StandardMacrosLib = FindObjectChecked<UBlueprint>(StandardMacrosPackage, TEXT("StandardMacros"));
UEdGraph* ForEachMacro = FindObjectChecked<UEdGraph>(StandardMacrosLib, TEXT("ForEachLoop"));

UK2Node_MacroInstance* ForEachNode = CompilerContext.SpawnIntermediateNode<UK2Node_MacroInstance>(
	this, SourceGraph);
ForEachNode->SetMacroGraph(ForEachMacro);
ForEachNode->AllocateDefaultPins();
UEdGraphPin* MacroExecPin = ForEachNode->FindPinChecked(TEXT("Exec"));
UEdGraphPin* ArrayPin = ForEachNode->FindPinChecked(TEXT("Array"));

And then I’m wiring up the pins. However, when I compile my node in the editor, I get the following error:

Unexpected node type K2Node_MacroInstance encountered at  Execute Bound Query

Can macro nodes not be created within ExpandNode? I was hoping they would be treated like any other node and be expanded recursively.

It appears that it may not be supported, but there is an example in engine code of someone manually reconstructing the logic of the “ForLoop” macro. Take a look in Engine\Source\Editor\BlueprintGraph\Private\K2Node_ForEachElementInEnum.cpp specifically the FForExpandNodeHelper::BuildLoop method.