I did once - but it was on purpose. After 4 years at AWS, and ~20 in the industry, I was utterly burnt out, and needed a break. So I took two years off.
I think I'm burned out, but I'm not sure. Sometimes I think getting laid off might be good for me, but being in my mid-forties worries me when Tech is so ageist.
Being middle age is a risk for sure, but also keep in mind you have only one or two big changes left before you're done. It matters more to get into a spot that can take you where you need to go.
Good luck with it.