Thank you @srek and @jbatista!
Your answers are interesting, but I would not be able to do exactly what I want. Or rather, I actually really need to take an instance out of the hierarchy, but it should only come out of the hierarchy through the activation of a userdata button.
I searched around a bit and found a script to put in a Python tag that almost does what I want: by pressing an "Unparent" button attached to the Python tag, the instance exits the hierarchy. The problem is that the script uses a callcommand which is not the best choice, plus it is triggered by a button that is in the userdata of the instance itself (I would like the button to be in the null parent) and finally that it is triggered by a button instead of a boolean as I would like.
Would you be able to suggest solutions to fix this? Is it possible to "transfer" the button from the instance to the null parent? And is it possible to have the script triggered by a boolean tick instead of a button as it is now? Attached is the scene with the tag I am talking about.
In any case I thank you and wish you a good day!
Unparent.c4d