By 50, if you've played your cards right, you have a lot of connections, a lot of expertise, and you've become rather expensive to employ.
So you do attract attention from the cost cutters wherever you work. But it also means that you might deliver more business value as a consultant than as a full-time employee anyway.
I've seen people who got ahead of this trend, they planned for it, and made it work. They prepared for a long time and then they left. Instead of treading water in the same job for another decade, they semi-retired into consulting.
You do it when you're prepared, you've done your homework, and you can name a couple of companies where you have contacts that would probably be interested in retaining you. Often, your first customer is your former employer. Because if you were doing an essential job, they probably won't be well prepared for it, and they'll want to re-hire you on a consulting basis to oversee the transition.
You end up getting less total compensation from them, but you get paid at a higher rate per unit of your time. Then you string together a few other gigs. If you can't get as much work as you want you at least have some flexibility, maybe you end up spending the winters in a low cost country or something.
The key is in the preparation and paying attention to the right details while you're still in corporate. If you do it right, it can actually help your interests stay aligned with your employer's throughout your entire career. If they have cost pressures your switch to consulting can be a win for them too.
Like a lot of things in life, the key is to know when to quit.