I've been laid off 5 times since 1993, so, obviously, staying longer at those places wasn't an option. Two of those 5 companies have either essentially disappeared or so changed that, either way, I would probably still have been laid off, just a few years later. Of the other three, one was so marginal that its survival is an ongoing uncertainty - a layoff looking for its time. And a fourth, the 75-mile daily round-trip commute was getting really old (though I liked my work, the company, its products and its people) - not a good long-term prospect.
Might-have-beens fare poorly in the face of cold, hard, rational, examination. God really does know best - in guiding our choices and in making our "choices" for us.