Why work for/under people who would do you that way? There's plenty of money to be made out there. If I have too much "experience," they'll just have to miss out on it.
I'm a lead. Getting another lead role would be difficult. Managers in tech are uniformly bad in my experience. If I don't tolerate this then I'll have to tolerate some other form of ridiculousness, but while I'm young I can listen for the dog whistles and report them.
Edit: these kinds of managers will always screw you one day; usually that day is a day when your interests aren't as useful to them. It's a mentality (and behavior pattern) that Succession does a fantastic job of roasting. The trick is to read the writing on the wall and the room, find a new job, and bring all the homies.