You can use the deleted_term_relationships
action to check if some term is removed from a post object.
This hook is in the wp_remove_object_terms()
function custom_remove_category( $object_id, $tt_ids, $taxonomy ) {
if( $taxonomy == 'category' ) {
if( in_array( 3152, $tt_ids ) ) {
wp_remove_object_terms( $object_id, [1208], 'category' );
}
}
return $object_id;
}
add_action( 'deleted_term_relationships', 'custom_remove_category', 10, 3 );