Uber rewrote its entire backend and both major mobile apps between 2014 and 2019. While there was definitely some reuse, we switched languages on several of these so there were direct ports as well.
It took a lot of engineers to do this while also launching several new business units and scaling to hypergrowth simultaneously.
So yes it can be done, but it will come at a cost and you need to be in a position where the business won’t fail if it takes a long time, or you can afford to run several concurrent legacy systems at the same time.