I can give you my perspective on it as someone who went the dev -> architect/team lead -> university level education in management -> stress -> adult ADHD diagnosis -> dev route and the extremely short answer is that you do not move into management it you want to code.
What you need to do is to figure out not only what you want to do, but what you like to so. I excelled at management, I enjoyed being involved in significantly more important projects and seeing how the world works form the perspective of really high level enterprise management on the national scale of the public sector while being there as what is essentially a specialist advisory role. I enjoyed working with people and helping them find their motivation and grow, and I never got put down by the hard decisions, but as it turned out, what I’m actually build for is solving problems. It did turn out that I had undiagnosed ADHD and what some people call “flow” I call “hyperfocus”, what some people call “boring” I call “painful” and what some people call organisational politics I call hell. Now all of this wasn’t triggered until I had my first child, because it wasn’t until I had what was essentially 3 full time jobs (1 added for ADHD energy expenditures) that I couldn’t keep up, but when that happened it fairly quickly became apparent that I could never be a manager and a father of small children at the same time, and then what do you do? Well, one of my friends mentioned his company was looking for a developer, and knowing the CTO I reached out and got myself hired as a developer. In the past five months I’ve build some really amazing things, I’ve read manuals on how solar inventors work and setup data collection and distribution for our partners. I’ve build a typescript node package for generic Odata APIs and worked on cash flow predictions and I’ve had such a good time doing it that I’ve gone from part to full time (in a healthy way), something my leading psychiatrist thought would take five years.
Depending on your area of the world it’s very likely that you can’t make the same career out of programming that you can out of management, but there is currently a bigger demand for talented programmers than talented managers in a lot of places. So it’s certainly possibly to keep being a programmer if that’s your jam. You can also move into different forms of Enterprise Architecture and still do some amount of coding if the advisory specialist role appeals to you.
If you want to manage then I encourage you to do so, and go at it wholeheartedly. Which means cutting down on coding to the point where you no longer do any. You can still do it as a hobby, but not professionally. If you want to develop then I suggest you use your experience to find your way into places that are great to work.