I was just involved in a very painful departure of a team member. He asked me the same question over and over. He asked, "What did I do Wrong?"
It may be that he did NOTHING wrong. So many times I have asked a person to leave my team because he or she did not have the skills that the client needed. He did nothing wrong. He just had the wrong bundle of skills.
It may be that he did a lot of little things wrong. There are unstated norms about how people behave with one another. We question, "Am I calling you too late?" or "Is this a good time?" If someone does not follow those rules, it may break an unspoken rule. Too many broken rules and the whole relationship is in ruins.
It may be one really bad bit of work. I have given people "three strikes" and then four and then five — but if the work is consistently really not well thought through, not client-ready, not of high enough caliber, I've given up hope and asked the person to leave.
What every team member who leaves unsettled by the question "What did I do wrong?" might think about is that the team leader is asking him/herself the same question.
The team lead is asking, "What did I do Wrong?" because they never want that to happen again.