Renaming Collections broke references to variables

I created a couple variable collections in my Figma file. Ended up renaming one, then exported a collection, moved a group of variables to a different collection in the same Figma file, and then re-imported it to my Figma file through a Figma plugin. A few hours later I noticed many of my variables are broken, and both sets of the old-named and renamed collection both exist in the Appearance panel collection drop down (3 instead of 2).

Any help on getting rid of that old collection?