Yep. Most companies seem to turn-over their management ranks every 3-4 years (programming isn't the only "up-or-out" job), and there is always some inevitable merger/downsizing/reorg/etc. Good gigs quickly can change into bad ones.
Anyone whose managed to hold in the same place for 15 years has either been promoted up, or they've got their teeth sunk deep into some legacy system (which everyone else can't wait to get rid of).
Actually, I'm over 11 years, partly because of the inevitable merger etc. requiring some technical person to keep doing new things to the same old, and same old to the new versions (including upgrades to web enabled versions and the latest db technology). Yes, I'm deep into legacy, and have told them in so many words I'd be happy to convert to whatever they decide is better. So I'm doubly protected - either they keep the same ol', which means a small conversion project and more new programming, or I do a huge conversion project and get the new skills. This should keep me going until I retire. Wife and two kids and two cats and giant house in subruralia (nicer than suburbia), why would I want to turn over? People denigrate the idea of doing the same thing over and over, without evaluating how same is same. I worked on the grandparent of this software, when relational technology was some newfangled idea.
Don't cast too many aspersions upon the legacies in the world, they have their place, and the more obscure they become, the more lucrative. And they still have to deal with the new stuff, one way or another. (The odd place still using punch cards notwithstanding.)