X not in list error when trying to remove collective.plonetruegallery from plone 5.0

Hi
I am having a real hard time trying to migrate a site from plone 5.0 to plone 5.1 thanks to collective.plonetruegallery. I have finally tracked it down to not running the uninstall profile in the zmi prior to removing collective.plonetruegallery from the list of eggs. I went back my plone 5 site so I could go try and complete this step but when I try to run the profile I see:

2018-12-10T15:04:47 ERROR Zope.SiteErrorLog 1544418287.970.75155033711 http://intranet.cook.local:8083/council/portal_setup/manage_importAllSteps
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.GenericSetup.tool, line 579, in manage_importAllSteps
Module Products.GenericSetup.tool, line 388, in runAllImportStepsFromProfile

  • traceback_info: profile-collective.plonetruegallery:uninstall
    Module Products.GenericSetup.tool, line 1433, in _runImportStepsFromContext
    Module Products.GenericSetup.tool, line 1245, in _doRunImportStep
  • traceback_info: collective.plonetruegallery.uninstall
    Module collective.plonetruegallery.exportimport, line 68, in uninstall
    ValueError: list.remove(x): x not in list

Does anyone have any thoughts on why this would be showing. I have made sure I don't actually have any galleries and don't actually have any need to use the product. What is happening at the moment is that my upgrade to plone 5.1 goes ok but when I then try and install an addon in the plone 5.1 version I see the main menu disappear with only the home button displaying and then see errors to do with PTG in the events.log so I need to get it properly removed and then go through the upgrade to 5.1 again.

Thanks for any help

As with all such error: you take the Python debugger and put a breakpoint inside the code where the error occurs and you check what's inside list and why x is not inside.

Thank you for your suggestion Andreas. I ended up using transmorgrifer and collective.jsonify to export the content and then reimport it into a clean 5.1 install and so get rid of any plonetruegallery errors that way.