This is an expression which we use occasionally( in the US anyway) when one is made speechless, frustrated, pulling his hair after numerous attempts to explain something or help someone but ending up with the person in need making the same mistakes. The "banging head" should have been a give-way....