> when you are both on the same career track
I think this is one of the root issues, the perception that management is somehow the natural next set for software developers.
Why should that be the case? It'd be like you trained all your life to be the best violin player you can be, then after some years somebody pats you on your shoulders and tells you it's time to start conducting.
I am mid-career, and interestingly I had a couple of short stints in management early career, as much as it helped me quite a bit now with team leading duties and in seeing things from the point of view of my manager when we have 1 on 1s, I would never want to be in management as my full time job.
Management and software engineering are, or should be, parallel tracks: there is no competition, so a software manager should be as thrilled to be able to hire an experience software developer as a young hospital administrator be excited if they are able to snag a renowned surgeon for their hospital.