Adding the modifier itself already adds a new node tree, which is then displayed in the node editor because of the active object and active modifier context. So there's no need to create the node tree in the python code in this case.
Adding the modifier itself already adds a new node tree, which is then displayed in the node editor because of the active object and active modifier context. So there's no need to create the node tree in the python code in this case.