Fix sorting for parent/child nodes

Fixes crash in duplication code, which assumed that parent layers would be first in the list.

Fixes #5203 (closed)

Merge request reports

Loading