Yes but then in the new job you need to maintain other people's stuff, which is even harder that maintaining your own stuff. And over time you get to own that, including all the previous tech debt that you didn't create
Dev shops don't have to operate like that, and all it takes is one person to have the fortitude to say no.