Corruption issues with multiple instances

I just got a new laptop and reimported my library, along with all the xmp files. I am currently using 3.2.1, but have used darktable for a while, so have some images edited with old modules.
Most images have imported correctly, but any images where I have multiple instances of the same module appear corrupt. If I use the history stack to revert to a stage before the multiple instances are applied, the corruption goes away, however only one of the instances is visible in the “enabled modules” tab, so I’m not able to turn them off individually.
Any help on how I can recover these images would be great.

It’s an old bug fixed now. But it can’t be reverted on old edited images directly as it was how the history is written the issue. So, the only possibility I know is to remove and recreate multiple instances to rewrite them correctly in XMP and database. So revert back before multiple instances is the good way, then recreate them.

That’s a shame.
For anyone with the same issue, I found two ways of dealing with the issue…

  1. Revert the history stack to before the second instance was applied. Unfortunately might mean some reprocessing has to be done.
  2. Save a style based on the existing image, but do not include the second instances. Then reapply the style using “overwrite”. Obviously the second instances then need to be redone, but potentially less work.
    Would be really nice if there was a way to identify these images and automate this process, as I see it as being the best solution to the issue.