honest recommendation: nuke and pave after analyzing (w/ AI of course) where it went horribly wrong.
it's trivial to reimplement a better solution.
it's trivial to reimplement a better solution.
Also, I am not sure if it is trivial to implement. The code is injected into many scenarios and workflows, so replacement will be painful and risky if new solution break some edge case.