This is a mashup of “hand him his head on a platter” (angry with someone and want him punished) and “have your hat handed to you” (asked to leave or to be fired from your job). The mix is caused by the words “hat” and “head”, and the word “hand” used in both idioms. “Hat in hand” (with humility) might also have been in the speaker’s mind. A lot of alliteration here. A big thanks to Jon Polk from @ClichesGoneWild for tweeting this one and sending it to me as well!