John,
Thanks for the clarification. I wish there was a warning too because it took me hours of trial and error. I thought I was doing something wrong, until I arrived here.
I think the last line before closing your function should be
wp_set_object_terms($post_id, $terms, 'YOUR TAXONOMY HERE', false);
The other one you have (set_oject_terms) is the hook… but I’m not an expert on this.
Thanks so much!