Hello Christopher,
The dynamic content code would only work or pull the data from the Page, Posts, Custom Post Type, Meta fields/Custom Meta fields, and Taxonomy, by using default WordPress Loop or you can use Looper as well. In your case, your data is not stored here so the dynamic content code would not work here.
If you are trying to create the gallery in the post you can use the ACF as a post meta where you can store the gallery images and call it from the Looper. Please have a look at this video.
Or you can use the default WordPress Gallery. For the gallery, I have created a default WordPress gallery. To create a gallery you need to click on the Add Media button —>Create gallery
Now you need to set the image size column. Please note you need to set the “Link To” as “File”.
It would add a shortcode to your content for the gallery.
For example
[gallery columns="4" link="file" ids="2029,2028,2027,2018,2017,2016,2015,2014"]
After adding the gallery you need to add this shortcode to make the image open in a lightbox on click event.
[lightbox selector=".gallery a"]
Hope it helps
Thanks