Updated code:
$newargs = array(
'post_type' => 'apartments',
'tax_query' => array(
array(
'taxonomy' => 'projects',
'field' => 'slug',
)
)
);
$the_query = new WP_Query( $newargs );
<?php if ( $the_query->have_posts() ) : ?>
//The query returns 0, if I use a taxonomy, for post types it works, and I can bring all ACF fields to that post. But I want also want taxonomy acf fields here.
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
//Custom field that Is inserted into apartments custom post type
<?php while ( have_rows( 'assign_apartment_project') ) : the_row(); ?>
<?php endwhile; ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>