I am guessing this issue happens when appending a sheet from another project, not when adding a new sheet.
I don't believe there is an issue in DLIST.
I am thinking there is a flaw in append sheet code (SCH_EDIT_FRAME::AppendSchematic()).
Especially it looks like the DLIST build from the imported sheet is added to the existing schematic (this is the purpose of the import) and when the temporary SCH_SHEET created for the import is deleted the DLIST is (incorrectly) cleaned.
I am guessing this issue happens when appending a sheet from another project, not when adding a new sheet.
I don't believe there is an issue in DLIST. FRAME:: AppendSchematic ()).
I am thinking there is a flaw in append sheet code (SCH_EDIT_
Especially it looks like the DLIST build from the imported sheet is added to the existing schematic (this is the purpose of the import) and when the temporary SCH_SHEET created for the import is deleted the DLIST is (incorrectly) cleaned.
Managing complex hierarchies is always tricky.