You know, happens to us all but you never know if it's good or bad long term. For instance, I didn't get a contract renewed at a research gig a while back it worked out to allow me to stay home and teach remotely part time, being with my kids.
Prior to that, I kept getting runner up status on dream jobs in educational research. Literally second place after rounds of interviews; left me very discouraged and low self esteem. The positions I felt most bad about? US Dept of Ed's NCES and another in the Kennedy Center for the Arts. Guess what? My life would probably be hell right now if I got either.
Life just... happens. It's like a plane crash you avoided but were late to your flight, only with employment.