Tossing the bird in its cage is not directly associated with the action of chewing the table. You don't know exactly when the bird chewed the table. The bird cannot control the outcome, and it cannot stop chewing the table to avoid the punishment. In situations such as these, punishment seldom affects the unwanted behavior. Punishment should always be avoided when working with animals.
Animals live in the here and now.
They do not understand that they are being punished for something that happened in the past. What's of primary importance to them is what is taking place right now. Later, the dog returns. The master whacks the dog. The dog must now decipher which event earned the whack.