<xtree>: Use scope guard for node copy failure
#4749
Merged
<xtree>: Use scope guard for node copy failure
#4749