I'm sorry you're going through this. Especially with the whiplash effect, that's terrible.
Having gone through similar, all I can offer is to not take it too personally. It's impossible not to, to some degree. And it sucks when you feel intentionally shoved through the cracks rather than falling. But it's possibly just as much some shit HR math or bad luck that is why you got nailed. It's likely not about you as a person, and more as you as employee #5552683 that was convenient. Which is little comfort beyond the fact that it might not have been targeted.
Take time to process, but please don't let this get you down long term.