Proper way to run wp_query from inside a plugin

Here is what solved it (although I am not sure WHY since any of the individual actions below did NOT solve it):

I got rid of the action, changed from WP Query to get_posts, and moved reset above return.

function myfunction(){
$mcpt_query = array();

$the_query = get_posts('post_type=mcpt');

foreach ( $the_query as $post ) : setup_postdata( $post );
$mcpt_query[] = array(
    'id'       => get_post_meta(get_the_ID(), 'idkey', true ),
    'field1'   => get_post_meta(get_the_ID(), 'field1key', true ),
    'title'    => get_the_title($post->ID)
);
endforeach;
wp_reset_postdata();
return $mcpt_query;
}