Why doesn’t the Gutenberg code editor allow code to be nested in sections?

I’m trying to add my own HTML code in the Gutenberg code editor, but unfortunately when trying to save the editor automatically moves the closing tag </section> to the end of the first line. What is this about ? Why can’t I nest my code this way normally ? To illustrate the problem I attach a picture.

enter image description here

I would like the section closing tag to be at the end of all code.