There’s the old saying, “Sometimes you have to give up the good for the great.”
Mainly, I disagree as you won’t ever know if you gave up the good for the great. This is completely speculative. Once you make a decision, you have selected one path from another.
This is not to say that multiple paths won’t get you to the same location. But if you have to decide between taking a job with Company A or Company B, by choosing one you’re not choosing the other.
If you pick Company A now, you might end up at B later down the line. However, your life will be different from if you chose B now, and ended up (maybe?) at A later down the line. The thing is – you will never know how your life would have been different.
So don’t stress about how your life would have been if you had made a different decision. You will never know, so make your decision and stick by it.