How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

pre_get_posts is executed before each and every query. Your $query->is_main_query() is making this code change the query only for the Main query. So, if you’re in an archive page, you’re modifying only the archive posts, and not any of the others queries (widgets, menus, etc).

But be aware, that code you added there will change the query for ALL your main queries. So if you go to another post type archives (categories, etc) you will be modifying the query to get the post_type = employee