I’m going to quote this answer https://wordpress.stackexchange.com/a/242254/91219
Order really shouldn't really matter but it's good practice to register things in a hierarchical structure.
register_post_type( $cpt, $args );
register_taxonomy( $catname, $cpt );