Hi,
I looked at it yesterday and also saw the problem
with a line of code I can also delete the data with one row of code,
but I knew no way "from a user point of view" to solve the problem.
Today I did a test and it works with native commands and the GUI,
how the user usually works.
However: I have not found a way how the user can find out about the problem at all,
that was only possible in other ways.
So I present the solution, but you cannot check in the program beforehand whether this problem exists at all.
++
Problem: Data from sheet sets / Sheet list tables and other data / perhaps from XRef-binding in the past.
Solution: Create a new table set table of contents, this causes an update of AutoCAD which deletes the obsolete data.
Then you can delete the table of contents.
Add one layout to a sheet set and insert a sheet list table to your Layout.
(You are familiar with sheet sets and Sheet list tables? -> SheetListTable[F1])
That's all, you can delete the new sheet list now.