Update product category from event tickets

I am using The Events Category and Woocommerce for the ticketing and payments.

I successfully added a code to take the featured image from the events to automatically add it to the tickets (woocommerce products) with this code:

add_action('save_post_tribe_events', function($post_id){

if(wp_is_post_revision($post_id)) return; //Bail if this is a revision

$tickets_provider = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();

$tickets = $tickets_provider->get_tickets_ids ( $post_id );

foreach($tickets as $ticket_id) set_post_thumbnail($ticket_id, get_post_thumbnail_id($post_id));

return;

});

Now I am trying to do the same with categories, with no luck, using this:

add_action('save_post_tribe_events', function($post_id){

if(wp_is_post_revision($post_id)) return; //Bail if this is a revision

$tickets_provider = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();

$tickets = $tickets_provider->get_tickets_ids ( $post_id );

foreach($tickets as $ticket_id) wp_set_post_categories($ticket_id, wp_get_post_categories($post_id));

return;

});

Does anyone have any thoughts?