Sure, but there's nothing particularly programming-specific about that situation.
It can happen with any profession, and I can't see that it's any more likely for programmers.
[Personal note: I'm my late 40s, and have been a professional programmer my entire working life. I still love it, and can't think of anything else I'd rather do.]