Your checks inside pre_get_posts are wrong. By using function conditionals you will modify all (!) queries on matching page, not just main query. The conditionals used should be methods on passed query object. is_main_query() is special kind of disaster. It’s not actually telling you what you would guess from the name, useless in practice, and so misleading they had to add error message inside of it especially not to use it in pre_get_posts.
Your checks inside pre_get_posts are wrong. By using function conditionals you will modify all (!) queries on matching page, not just main query. The conditionals used should be methods on passed query object. is_main_query() is special kind of disaster. It’s not actually telling you what you would guess from the name, useless in practice, and so misleading they had to add error message inside of it especially not to use it in pre_get_posts.