After removing elements, there were a few cases where the tree wasn't properly balanced which could further down violate assumptions about the layout. Attached is the original testcase that triggered it. I didn't bother simplifying it.
This is a GListModel implementation with a neat API that can be used to implement trees inside GtkListBox.