That is a courageous choice as others have said. You are ultimately doing the right thing for yourself and others. There is possibly an opportunity in the transition if you are staying with the company to set yourself up with some dev work that will let you recover. Depending on circumstances, a passive handover puts you at risk of landing in an awkward spot.