maybe that works:
<?php
$blubb = '[gallery ids="';
$images = get_field('acf-gallery');
if( $images ):
$counter = 0;
foreach( $images as $image ):
if ( $counter > 0 ) {$blubb .= ',';}
$blubb .= $image['id'];
$counter++;
endforeach;
endif;
$blubb .= '"]';
echo $blubb;
?>