Main menu not appearing in custom post type archive

It’s because when you use the is_post_type_archive( 'object' ) condition you’re checking whether the main query is a post type archive, not whether this query is a post type archive. This means that your code will apply to all queries, including for menus, on the post type archive.

You need to use $query->is_post_type_archive() to check the specific query that is currently being filtered. You already did this correctly for $query->is_main_query().

if ((is_front_page() && $query->is_main_query()) || $query->is_post_type_archive('objet')) {
    // etc.
}