Layer order is not preserved, even with locked layers. Copying, exporting, and importing a module changes the layer order

This design:

While dragging it looks okay:

But when dropped on the editor:

The layer content of the original is:

But layer content of the copy of it becomes:

I solved the issue by removing the group names even do z-index are all stored as 0 in the project file, reordering them without groups made them stay in order.

Exporting as a module, and importing. or reloading the project. all works out now.

thanks! im on it