Yeah, sometimes you have to rewrite/rearchitect but more often you don't. But sometimes the job is to actually get some one to let go of the control of strange baby they implemented so you can rewrite.
Years ago I worked on DNA analysis software where the entire thing was abstracted; codons could be any number of bases instead of just 3, there could be any number of bases instead of 4, there was a whole system for managing amino acid names that assumed there could be an infinite number of amino acids. Loading a sequence involved millions of checks to see if there were any matches against 4 base codons or 5 base codons ...
That definitely was a rewrite; but the developer fought it every step of the way.
In order to write a good application the process it is going to support needs to be well documented. This wasn't the case and I had to go back in circles a few times but you live and learn.
I've dealt with a product that was so poorly architected that, to this day, it is constantly causing production outages, bad data, etc. And the root of the problem is that it wasn't built to do the right thing. At it's very core, it processes and stores data incorrectly. (Leading to "there are good days and bad days and ops will handle it").
Yet, I met the "We CAN'T REWRITE" pushback, which, ok, but here's the solution that doesn't involve a rewrite, it'll be 10x more expensive because the slow evolution will be a whole lot harder and more risky than a fresh solution with an adapter to the old interface.
I certainly don't take rewriting lightly, and don't generally suggest it, but I have to ask. How can you sell it when the alternative is what my company deals with today?