This is an engineering maxim as old as time.
If your response to theoretically old, brittle, and "wrong language" code is "rewrite it in something better", you don't understand the problem.
There has never in the history of software development been an effort to rewrite a platform in another language which wasn't subsequently plagued by all manners of new and interesting problems.
In a best case scenario, the product has an exhaustive regression testing framework, complete unit tests for every function, e2e testing, and reintegrative CI/CD. But that is rarely true for any project, and certainly isn't true for old ones which predate such practices.
You make an important point: the biggest positive contribution to making old tools better without introducing more brittle behavior is with coverage from test suites, and improved code coverage.