How to extract a subtree of my tree?

You are right, but while I can make sure of the topology of my own tree, a rule made general and public must expect the user did not perform any such precheck.