HOW MANY TIMES CAN YOU BE SHOT DOWN?

Have you asked them why they didn’t hire you?
I know it’s awkward and the last thing you might want to do but it might be a good thing to just ask to have a chat with someone from there to get their perspective why the other person was better. It also means if another job comes up there in a year or 2 you can go back and say “hey you didn’t hire me last time because of X and so i have been working on X”.