Not sure what you’re trying to do, but the problem you’re having with this specific bit of code is that you’re using the wrong function. You want get_the_post_thumbnail() instead. The function the_post_thumbnail() echoes the result of get_the_post_thumbnail().
$args = array(
'post_type' => 'post',
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page' => 1,
'category' => '2',
'paged' => get_query_var('paged'),
'post_parent' => $parent
);
// The Query
$the_query = new WP_Query($args);
// The Loop
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo get_the_post_thumbnail();
}
} else {
// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();