If a business decides to migrate from X-lang to Y-lang (or X-system to Y-system) for some particular and sensible reason can the business afford to spend a couple of years to restore its productivity to what it was?
It might, but there'll be a significant cost, even outside of developer attrition. In a lot of operating businesses the opportunity cost is quite high given all the moving parts that sustain its current operations i.e. people, processes, etc.
It's a tough call; and a one-time automated code conversion may be the smallest part of it.