I'm sorry it didn't work out for you. Sometimes it's luck of the draw. It also depends a lot on which industry you're in (finance, gaming, etc.). As an extreme example, if you're any good at COBOL, you can probably get a job working on legacy systems regardless of your age. Gaming, probably not so much.
You may have more success getting smaller freelance jobs at first and building a reputation as a can-do developer, which might be easier to parlay into a full time job. But at the end of the day, connections are sometimes the most important factor, so I would encourage anyone in your shoes to work on not just their technical chops but also their people-meeting skills.
No, I'm saying getting a freelance job is often easier than getting a full-time job because the barrier to entry is lower: companies don't usually scrutinize freelancers with the same eye, especially for smaller jobs, since it's much easier to let a freelancer go if it doesn't work out. Also, freelancers are usually hired based on their ability to get the work done, not so much biased metrics like age and gender. Of course, every industry is different, but that has been my experience as a freelancer for several decades now.
Although in the case of the person I was replying to, apparently even getting an interview was impossible, so YMMV.
You may have more success getting smaller freelance jobs at first and building a reputation as a can-do developer, which might be easier to parlay into a full time job. But at the end of the day, connections are sometimes the most important factor, so I would encourage anyone in your shoes to work on not just their technical chops but also their people-meeting skills.