After deleting a Dynamic Panel layer, cannot reuse IDs of the (former) layer's contents without closing/opening the prototype

Dave shared this problem 4 years ago

I deleted a layer of a Dynamic Panel, then duplicated a similar panel, then set about renaming all of its contained components (see "Duplicate Panel" loses IDs of panel contents).

Justinmind reports that all of the IDs of the components of the (now-deleted) layer already exist. I am forced to close and re-open the prototype (or quit and restart Justinmind), losing the open/closed state of the enormous and complex outline.