Leaving academia at 39
desparate [...] terrified [...] depressed


First of all, however, I think you need to get proper counseling.




   Does anyone have managed to leave academia after 40? 


I'm maybe within 5 % of that mark - but my story is nevertheless quite different from yours: I like research, I like teaching, I didn't look for a job when I left: I'm freelancer/self-employed now, my field (analytical chemistry + statistical data analysis) is quite different from yours. I decided early that I don't want to become a professor. Last but not least, I'd been considering this step for a long time. I.e. I considered this my plan B in case I end up without a new contract at some point. As it is, it was I who didn't renew the contract, and I took the opportunity to do a slow transition by part-time remote work at my now former employer.

I'm still involved with research and closely cooperating with research groups. And I'm teaching both in industry and in academic settings.


  And are you happy with the change?


Very much so. 

But I'm sure you realize that neiter is n = 1 a proper base for decisions nor will you be able to predict much how you will do even from a good poulation description of 40-year-olds leaving academia since the variance will be large.



I'd also like to state the somewhat obvious that by asking on academia.sx you'll probably get mostly answers by people who are still close to academia, since those who cut all ties to academia are very unlikely to read your question. And this means a selection of people who probably like research or teaching or both.