In my decade and a half of software engineering experience, this has happened exactly once - we cobbled together something to validate a concept, then completely fucking scrapped it and built it from scratch.
I honestly don't know if it'll ever happen to me in my lifetime, and I wouldn't bet on it. Supporting the "shit software" for the lifetime of the business isn't something I'd want to do.