Here is a dish, inspired the nursery rhyme Sing a Song of Sixpence, suggesting that blackbirds were baked in a pie and flew out upon cutting into it. The pies were obviously baked prior to tethering the poor little things inside, but produced a spectacle of unrivalled proportions, fit for a King!
If you want to go the whole way with this (why you would, goodness knows and I suggest you get counselling), it is essentially safe for the birds, but a pleasant alternative would be to use wind-up toys instead and these such medieval automata and table toys were actually sometimes used!