When importing a database any page with a wp_query in doesn’t work

Moving a site from local to live should not effect queries like that one, where there are not hard-coded values like post IDs or post slugs that might have changed with the migration (depending on how you migrate).

What could conceivably be happening is that the page/page-template association gets broken. That information is stored in the $wpdb->postmeta table under the key _wp_page_template. Depending on how you migrated the associated post ID could be different than stored in the database. Your statement that “… if I create another page, using the same template as the one with the wp_query in it works just fine” seems to support the theory.