It happens quite rarely, but it happens. I think I would have done the same in such a situation.
The main thing is not to give up and not to pay attention to temporary setbacks
I had AA against KK all-in preflop in an online MTT. Flop came A-K-2 — I thought I was safe. Turn: K 😱 River: blank. Set over set, turned into full house over full house. Out of the tournament just before ITM.
I have one that's just as bad, I think most players have, when the other dude needs to hit two absolute cards in a row and does so. Sad when it happens to you.