Solver fails, how to recover previous state

As this is an issue with PETSc, someone would need to report it to their issue tracker.

You could re-create the solver, but you should avoid doing it too often, as shown in: Force clear PETSc solver from memory? - #8 by dokken
As the solver does not cache the previous state (it depends on the form, it should be possible to do