Ahhhh yes. Every single one of my kids has done this. It is totally a temper tantrum. It will eventually pass. When my son does the arching thing when i'm holding him, I set him down. When he is doing the head banging (does it in his high chair, and will run up to a wall, a cabinet, anything really and throw his head into it... sometimes the front, sometimes the back. I won't even look at him when he does it. I say you can be upset, but I wish you wouldn't hurt yourself, you're not getting what you want this way.
It's attention seeking behavior when in the context you describe. I can say my son has learned to bang his head a bit more gentle because he discovered it hurts :)
i had planned to move him to a 'safe' location if it continued the way it was going, like a playpen or his time out chair, but it has seemed to lessen quite a bit. Now he only does it about once a day, when he is hungry for dinner and is getting tired. he's at the point of eliminating the afternoon nap on most days so he's a bt frazzled at the end of the day and loses his composure much easier than when he's well rested.