on_remove_child calls tree_close_internal which calls tree_render and the tree is in an invalid state if con->parent still points to the old parent. Fixes #3556