OK so I realize that this counts as "weird edge case", so I've attached an image:
Obviously it's checking if the number of subcategories equals zero rather than >= zero. As for why I have a negative-sized category? No idea. But the page is reloadable, so it's a persistent issue with CategoryTree.