Thank you!
It only works with the following modification:
<?php
$galleyPost = get_field('post_gallery_field_name', false, false);
$image_ids = get_field('photo', $galleyPost, false);
$shortcode = '[gallery ids="' . implode(',', $image_ids) . '"]';
echo do_shortcode( $shortcode );
?>