I’ve been fortunate enough to avoid the experience of layoffs, but learned the same lesson by pouring too much of myself into a role and burning out.
Until you’ve directly experienced the reasons work isn’t a family, etc. it can be hard to avoid falling into the trap of thinking that it is.
I would also say that most takes on this are a bit too binary, and some of my longest lasting and strongest friendships came from past jobs. I think the key to use work as an opportunity to establish those relationships instead of a ready-made support system, and not extending the personal aspect of those relationships into workplace behavior (e.g. doing more work because it’s “family”).