Switching companies frequently increases comp, but it’s less safe from the point of view you brought up around starting from square one in terms of rapport and “safety.”
I think this is a normal trade off. You left a team or a company for more money. There is nothing wrong with this, but you necessarily need to start from a new context since it’s a new team. When times are tighter because of economic cycles, this means that you should be more intentional with changing a team so that you are sure you will be able to compete with Joe Google Engineer. It’s still a competition in some ways, and that’s fine.
If you find a good place, stay a while in tighter economic cycles in order to build more skills and rapport and then hopefully, and realistically based on experience, you’ll have more runway within that company even if times are bad or if your performance sometimes is low because of life events.
Your mindset is only valid in the explicit context of a company
A) not having cut you
B) having cut others prior to you
As soon as that context is lost in the next two years when you get fired or find a new job, you're back to square one, except you're also competing against Joe Google Engineer.