How do I get_the_postID() for a custom post that uses ACF repeater field?

From the plugin code I can see that it uses query_posts() to set up a new context for your template if you’re using display="blah.php".

So you should just need to add the loop around your template:

<?php
/**
 * Template Name: Gallery
 */

while ( have_posts() ): the_post(); // <-- Important bit
    if( have_rows( 'card' ) ):
        while ( have_rows( 'card' ) ) : the_row();
            // Stuff
        endwhile;
    endif;
endwhile; // <-- Important bit