Life is fairly random. You end up with people, problems, and cultures you’re ill fitted for. Or are even outright toxic. All you have to go on is the interview and sketchy Glassdoor reviews to make an assessment. It can seem that the team seems great, but you get stuck with a boss that doesn’t suit you well or a poor team. You mostly can’t control this stuff.
Often we can switch teams or jobs before you’re let go, but other times we just get blindsided by a layoff or being fired.
Be realistic about the very very small set of things you influence.
It’s up to you to do what’s best for yourself.