I did this once accidently and it wound up visually wiping out half of my connections. When I attempted to re-add the group's that were now missing it pops up an error 'Group with same name already exists'. I then took a look at my Favorites.xml and was
able to resolve the issue.. Its completely reproducible
First you Create a Parent Group and then create a sub group under it. Drag the parent into the Sub Group. The entire tree then disappears from a GUI standpoint. Looking at the XML this is the issue.
testis the parent, test2 and test3 are both sub groups of test. As you can see the Parent of test is the Group id of test3 which has a parent of test.
This is easily fixed by updating the parent of test with the group id of its actual Parent.
Might be a similar bug to issue #34739 but that's an old issue from 2013 so not sure if its even on the radar at this point