Add media button always inserts media on the next wp_editor instance when created dynamically

Apparently the problem was that the id did not start with a letter and this caused all kinds of problems. Adding an incrementing number after the string fixed the issue:

<td><?php wp_editor( wp_kses_post( $content ), 'id' .$step, $settings ); ?></td>

The credits for the answer should go to @Sally CJ. Thank you!!