It's a trend away from the post-WW2 "promise of lifetime employment". Over the decades, companies have crept toward "human autoscaling" so slow no one noticed. You're far from alone - every other company is doing it. Go see the numbers at https://layoffs.fyi . When the whole industry is doing something, companies must follow suit to stay alive.
Nurture your network! Keep being present on their feeds. Reach out to the ones on your team that you had personal relationships with. Some will shun you; it's not personal, they're ashamed and fearful. It is human nature, same as the company's behavior toward you is a company's nature.
There was never a better time to take things into your own hands. Go look at @IndyDevDan's content on youtube and test the limits with agentic coding: https://agenticengineer.com/state-of-ai-coding/engineering-w...
Spend your 8-20 paid weeks agentic-coding (not vibe-coding) silly projects for your nieces and nephews. You'll come back stronger and more employable than ever.
Don't be sad to be kicked out. The boot that kicked you was attached to a Hills Hoist.