You are only entitled to pay what you believe the meal to be worth as far as I'm aware. I don't believe there is a legal requirement to pay as such.
I have never walked out, but I've complained a few times. One I remember, is quietly finding a member of staff to tell them my grilled chicken had a piece of wire in it (no doubt from the grill brush). He basically forced me to take the meal for free. The reason for this is that so they admonish themselves from any other responsibility, if the meal is free. I'm happy to go back to the restaurant personally, simple error.
Not surprised by some of the people in here that feel entitled to walk out just because they had to wait at the till. Use your voice, not hard.
Best complaint for me was whilst in an Irish bar in Philly, and my wife didn't have her passport to prove she was over 21 yet clearly being well in excess of 25 (they card under 30)... cue me being mega stroppy, so I ordered a pint of milk to drink, knowing that being a bar they would be short of it. Didn't drink any of the milk. Pretty silly... except the chef for the place came out and gave me the evils lol. (and yes we all paid.)