This is kind of what I did. I was VP of Engineering etc. at different companies and wanted to go back to coding, see: https://blog.jgc.org/2012/02/programmer.html.
Of course, I then ended up being CTO again!
Of course, I then ended up being CTO again!