I think you have several points working in your favor.

A big one is that you can do more than just code. You've planned and delivered projects that solve business problems. Even if you don't consider yourself a project manager, the ability to take business requirements and translate them into applications that solve business problems is valuable.

Also, consider the possibility that 'aging out' might be a lot smaller in some subsets of the development community than in others. In my experience, companies using .NET are likely to see age and experience and even a few gray hairs as a good thing. Probably because .NET tends to be used by older, more established companies. So you might consider looking more in that direction. Just be careful not to end up in a job where your sole duty is the maintenance of an ancient VB.NET Web Forms app. You can have a lot of fun with C# and .NET Core, though.

I've also noticed that .NET interviews are a lot less likely to use Leetcode-style problems. I've always prepared for those kinds of questions, and was even looking forward to them! But I've never encountered one in an interview for a .NET related role. They've always been more interested in getting to know me and talking about the problems I've solved. There have definitely been take-home coding tests, but they've always been the kind of test where they ask you to create an application using ASP.NET MVC or ASP.NET Core, and they've always given a set of specs telling you what the app needs to do. I've never had one of these take me more than a couple of hours.

There are no guarantees, of course. Someone else who replied mentioned they had a crappy .NET interview where all of the questions were about SQL. On that note, if you like .NET then learning some of the more advanced bits of SQL Server and T-SQL wouldn't hurt - and might actually be fun, and will even carry over to other databases. For example, if know how to use PIVOT in T-SQL to flatten several tables into a single report, you'll find it pretty easy to do the same thing with crosstab in Postgres.

Finally, consider looking at programming jobs in non-tech companies. I know this goes against advice I see often on HN. But I've talked to many developers who seemed super happy working for banking, insurance, and manufacturing companies. I've seen a lot of age diversity among devs working for these companies, too. Without a doubt, there are some non-tech companies that are terrible work environments for developers.

But there are also plenty of them that understand the importance of technology, and actually treat their tech people with respect. If you ask the right questions in the interview, you can usually get a good sense of how developers fit in with the rest of the organization.

The downside is that you're more likely to end up working on boring projects at non-tech companies. Lots of CRUD apps, lots of wrestling the data you need out of massive, not-so-well designed databases. These companies will probably pay less than tech companies, too. But you'll probably work less, and deadline pressure won't be as severe. There are certainly non-tech hellholes where you'd end up with long hours and low pay. That's why you ask lots of questions during the interview to try to weed these companies out. If you do that successfully, you may just fine a company where you'd want to stay for a decade or two. You might also have the opportunity to make a big impact in ways that you wouldn't at a tech company. You'll probably find lots of low hanging fruit in the form of problems where you can apply very basic AI/ML to help the company save money.

Anyway, that's just one possible path. sloaken's reply mentions 4 choices, and I agree that they're your best options. I suppose all of my advice above falls into option 2 on sloaken's list - settle into a secure job at a non-tech company that's likely to be around for a long time. You could even combine 1 and 2, and aim for dev management/team lead at a non-tech company. In those roles, you'd be able to get to know people throughout the org - and learn about all sorts of painful business problems you can help solve.