Section numbering wrong on back matter

If I apply a layout with numbering in the title to a document in “back matter” it gets numbering wrong.
Maybe I am not supposed to do this, but I could, so here is the problem:

  1. Create a “section layout” with the numbering placeholder <$hn> in the “Title Prefix”
  2. Select “Add Back Matter” on compile options
  3. As the document in back matter appears in the compile document list, assign the “section type” that has the "section layout"created before assigned.
  4. Compile

In my case, the numbering of the document in back matter is like if this document would be the first inside the last document, said otherwise, the document before it on the list.

Some screenshot:

The “Endnotes” document is from the back matter, when activating it appears there, and clearly is not inside “Conclusiones Generales”:

When compiling, “Endnotes” gets 12.1 as if it was the first subchapter inside “Conclusiones Generales”, even there already is a 12.1 which actually is the first sub inside it. So “Endnotes” should be 13.:
Captura de pantalla 2023-03-04 a las 13.21.34

Sorry, I just tried with a blank project and I didn’t manage to get to have this “.1” but it repeats the number of the last instead of having its own.
Captura de pantalla 2023-03-04 a las 14.23.59

Anyway, I leave all the other that is happening to me just in case.

Also, maybe this is somehow related to this other problem I had with automatic numbering:

Maybe not but just in case is useful.

Of course, I managed it taking the Endnotes out from the Back Matter and putting it inside the Draft, but just in case here it is.