Setting Custom Taxonomies as part of wp_insert_post() →

If you’re trying to figure out why your custom taxonomies aren’t being set when you pass them to wp_insert_post() in your custom code, you might be running into the same issue I did. Luckily, it’s easy to work around once you understand why it is happening.