Loop inside query

This is a PHP syntax error – you can’t nest a foreach inside an array, you use it to build the array:

$query = [
    'post_type'      => $post_type,
    'posts_per_page' => -1,
    'tax_query'      => [
        'relation' => 'OR',
    ],
];

foreach ( $taxonomy_arr as $t ) {
    $query['tax_query'][] = [
        'taxonomy' => $t['taxonomy'],
        'terms'    => $t['value'],
        'field'    => 'slug',
    ];
}