I'm early 40s, started coding around 13 or so, so it's been 30 years of software for me. About ten years ago after living in the web programming world for a few years I got kind of the same feeling you have. I missed my forms and windows app development, so I went to another company doing what I remembered enjoying.
You can guess what happened next. I hated it. I remembered all the things that annoyed me about windows app development, and realized I was just tired of coding every day. Coding has never been what I like about coding, it's building things that do things. I started focusing more on the building side, this time with the team around me, and also just some non coding fun projects like learning auto mechanics, etc. I drifted into a management role by accident and found a ton of fulfillment in coaching and mentoring. After a while I started to miss the coding side, so I went into an architecture role where I still got to do coding but it was mostly exploratory POC stuff to decide on new technologies or not. I took a role after that as a principal engineer, and while these are all mostly just title changes, it gave me enough variety to be exciting again.
Today I tell prospective employers that I am someone that drifts between IC and leadership roles. I believe experience in both helps both. My drive waxes and wanes but I think that's totally normal for humans. I just came to terms with it and stopped worrying about it, and now I'm very satisfied in my career.