If it happens years into production, especially after the load has increased or requirements have changed, it is a legitimate version 2 :)
> it is a legitimate version 2
Maybe, but then the previous one was version 1, not a prototype. I've never seen people actually write prototypes, nor management accept time invested on writing prototypes, in any job I've had.
Prototypes always directly become version 1 on production, unless of course the whole project gets canceled mid-development.
I've seen rewrites introducing massive bughunts and upsetting customers without improving too much. I've also seen customers expecting and even relying on old bugs for comfort.
Rewrite is always a business decision and need legitimate reasons. You rarely have those reasons, knowledge and time between projects.
I like to remember how eBay have rewritten their backend three times.
Not because the previous version was wrong, but because it became inadequate as business grew and requirements changed.
I've never written a prototype, nor seen one written, in actual businesses. I've never had an employer with the patience to let me play with a prototype either.