That link shows the issue I've been experiancing and trying to debug now. Two thoughts have come to me. Passing the parent value in array...
$catarray = wp_create_category( $cat2, $catarray
might be causing it ? I considered that wordpress is somehow entering the parent id in a way that causes this. Taxonomy etc looks fine and all categories show in the select parent menu when making one manually. It's only in the list they do not show.
Also when manually adding one it makes them appear as if the approach uses by the admins create category form is better.