Query on post(template) id to create shortcode

Hi.
I want to display a template (built out as an advertisement) on my post template. Using ACF custom fields I have created a relationship field where the editor can choose between templates (based on category) to the post so the ads are relevant to the content. In the Query Loop I have a short code element, which I pull the post id into the shortcode. [bricks_template id="{post_id}"]. It works perfectly in the editor and in the preview mode, but on the live page it has the message. “Not allowed: Infinite template loop.” If I paste the same shortcode on the page without the loop it works fine.

In (my) theory this should work. I’m essentially just inserting a shortcode. What am I missing?