More often the past mistake is rewriting software in a newer language.
Like I've worked places where the business ran off a layer cake of '80s tech, '90s tech that partially replaced the '80s tech, and '00s tech that partially replaced the '90s tech, and were now on their way to launch a big project to replace all that with '10s tech, a project doomed to run out of steam half way through (because legacy code got hands), inevitably leading to a codebase that consists of three failed attempts to rewrite the '80s codebase, and the '80s codebase.
As the functionality of the code was business critical, and no shift in behavior could be tolerated, they're never getting out of this mess, and would have been better off staying on '80s tech.
It's good for job security that's for certain.