wp_insert_term doesn’t work with custom post type’s tax

The problem is higher in your code.

$cat    = get_cat_ID($developer);

will return false for a custom taxonomy, as it only checks the standard categories.

Use get_term_by instead.