Here's why it's wrong to think you did something wrong when you get rejected from a job:
Sometimes, a company has multiple candidates that pass the interview with flying colors for a single role. They need to pick someone, and reject the remaining great candidates. If luck or timing was different and you were the only great candidate, they would have just picked you. But now they have a few, and have a hard time deciding who is "better". Often, they kind of punt on hunches, gut feelings, or things that don't really say anything about you at all.
You end up with the "Unfortunately..." email anyway.
If you do happen to get some feedback, well that's actionable. It's something you can improve and the next time at bat you'll be in a better position to do well.