Craft Panel Structure Duplication Issue
That's just a quirky byproduct of two subtle features colliding...

Lazy-loading index - You don't immediately see the full list of elements. You'll need to keep scrolling down to reveal them all.

JS-based collapsing - Collapsing/expanding the tree is a client-side behavior. It uses JS to collapse/expand, then stores the current view in a session cookie.

The behavior is simply a minor local issue... it doesn't affect any actual data in your system. The only real solution is to refresh the page when you start seeing the weirdness. Your collapse/expand choices will be remembered, and the items will be reloaded as expected.