In the Ocean's 12, I remember the scene of Brad Pitt asking "What's wrong with you?" of Matt Damon, who had interrupted his sleep to ask a favor.
I think the phrase "What's wrong with you?" is more often used when someone scolds/blames somebody else for their wrongdoings rather than when they want to find existing problems (if this make sense).
Given the context, can I assume that Brad Pitt said it to show that he is irritated and actually showing his unpleasant feelings to Matt Damon?
Or was he just asking what problem Matt Damon has?