Welcome to our forum.
Yes, post grid inside another post loop will create infinte loop that casue 500 http error.
you need to exclude current post id in pos grid query via filter hook, please see the fist example code in documentation
Filters – post_grid_filter_query_args
I hope this way your issue will solved.
$current_post_id = get_the_ID();
$extra_query = array (
'post__not_in' => array($current_post_id),
return array_merge($query_args, $extra_query);
Please login to see your tickets