A lot of the age discrimination is a perception that you are unwilling/unable to learn anything new.
A former HR person was willing to admit that in a PBS interview a while back. And if you watch the entire thing, in particular the bit about getting a B in computers, you will see why they have that concern.
I nearly got stuck in this myself a year ago when job searching as the SPA surge blew past me until two years ago. I should have been using React for years, but at the time it seemed like a battleship for fly-swatting. React is probably my most requested skill among recruiters now.
A friend of mine did technical recruiting for a while and encountered the same thing. The older workers saw their existing skillset as their breadwinning skill and did not want to branch into other things.
There are plenty of juniors not that interested in learning either, but they never make it into the field or if they do, it is because they learned the hottest technology right away and so the need to learn new things did not come up early.
Obviously this is correctable. Just keep learning.
Some fields certainly have age discrimination like video games and the startup sphere. But a lot of that is also to facilitate exploitation. The pay in the former and often the latter is dreadful and they work you twice the hours. So they don't want the old guy as he can't handle 80 hours. But is that what you want to do anyway? As plenty of companies will pay a premium for 80 hours too.