I think first lines should be:
<?php if( have_rows('layout_section') ): ?>
<?php while ( have_rows('layout_section') ) : ?>
<?php the_row(); ?>
instead of:
<?php if( have_rows('layout_section') ): ?>
<?php while(the_repeater_field('layout_section')): ?>