Loop through ACF taxonomies and output associated posts

The ACF “Taxonomy” field lets you select terms from a taxonomy, not taxonomies themselves. So if you want your selections in that field to be used in your code, you need to:

  1. Remove the get_object_taxonomies() line and the subsequent foreach. You’re looping through terms, not Taxonomies,
  2. Make sure the Taxonomy field is set to return Term ID. As the primary key, this is likely faster than querying posts by term slugs.
  3. Replace get_terms() with the get_field() for your custom field. This is what you’ll be looping over.
  4. Change your tax_query to use term_id as the field, to match the output of the field as set in #2.

That will leave you with something like this:

$post_type="post";
$taxonomy  = 'taxonomy_name';
$terms     = get_field( 'taxonomy_field_name' );

foreach( $terms as $term ) :
    $args = array(
        'post_type'      => $post_type,
        'posts_per_page' => 5,
        'tax_query'      => array(
            array(
                'taxonomy' => $taxonomy,
                'field'    => 'term_id',
                'terms'    => $term,
            ),
        ),
    );

    $posts = new WP_Query( $args );

    // Output posts, etc.

endforeach;