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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)