To add to this, remember that YOUR CAREER can and will transcend layoffs, bad bosses, bad companies, etc. With few exceptions, the network you build with the good people you work with are a thousand times more valuable than your current role or predicament.
I've seen people get laid off or fired that, while not necessarily wishing 9/10 of them ill will, am satisfied/happy to varying levels that they are gone. These are people that are a combination of lazy, unintelligent, entitled, uncooperative, etc.
There have been people (~5 in my 25 year career) where I danced on their figurative grave.
There are some (mostly early in my career) where I as shocked, kept in some brief contact with them, but came to the conclusion that the company was right in their move.
There are some where I was immediately in contact with them, planning beers or whatever.
Then there are those that I have kept in touch with over my whole career and have essentially become close friends. We have our own private group chats, keep up to date on tech, people, opportunities, etc. PEOPLE LIKE THIS ARE WORTH THEIR WEIGHT IN GOLD.
Companies are not people. They don't have feelings and they will terminate people, often indiscriminately, over short term and trivial things like a single bad quarter or because some VP needs to flex their MBA. They can act stupid and if other people point it out and don't get a response, that either means you look stupid for not being able to see it, or worse you look like a hack that's never worth being reached out to again. That also ignores the fact that when people are hurt or in shock, they lash out a bit. Terminating the conversation just means you don't care or can't handle any emotion...
The smart people you've worked with at bad companies are often the best to keep in touch with, and you won't know it unless you're willing to open up about "saying bad things" about the company - or the people above both of you.