I have switched from Director of Engineering role to software engineer in Rust and happy with that decision. Even though it brings less income I learned a lot more in the past 2 years than in previous 10 years of management. I don't think you would lose your PM skills, you could only improve them switching to software development role. Just make sure to pick language where you will learn a lot, like OCaml or Rust.