The property identifier doesn’t change, what changes is the property displayed.
The code you link to is for the modifier UI, not for the node editor UI. The modifier indeed only shows the object.modifiers.active.node_group
property:
The one in the geometry nodes editor header is defined here.
So:
- When there is no active geometry nodes modifier in the active object, the node editor shows a selector for the general
SpaceNodeEditor.node_tree
property. - If there is one, it shows the node group property for the modifier:
NodesModifier.node_group
.
Worth noting that a node group is a node tree in fact.
Now the tasks suggests to create a modifier when selecting a tree in the first case. I’m not convinced that this is a good idea on the design side. I will raise that in the task.