You have no idea what you even did wrong. What you need to do is call up your friends and have them mock interview you, there's even free platforms and exchanges where you can do that. Get some actual feedback, don't act on wild conjectures.
Also keep in mind it could be as simple as that they had a better candidate.