The waiter takes the bill and delivers the payment to the manager - who decides that he's overcharged, so he gives the waiter $5 to take back to the men.
On the way back to the table, the waiter dishonestly pockets $2 of the $5 for himself, and give each man $1 back only.
That means that each man has paid $9 - making a total of $27. The waiter has $2, the men have paid $27... that comes to $29!
What has happened to the missing $1?!