Depends.
If the food sucks, or is barely cooked, or blah blah blah, thats the chefs fault. The waiter/waitress will probably apologize and hopefully they will refund it. If they can't refund it, that's the managements fault.
But in that case, that's bullshit if they were just dicking around while you had to do everything on your own. If the tip is supposed to be mandatory, add it to the fucking bill.