as far as i understand <?php get_sub_field($caption); ?>
for flexible fields works only inside <?php if( get_row_layout() == 'full_width_image' ): ?>
and that need to be inside the flexible field while loop
i don’t see that loop inside your file, and don’t know if you have it or not