I figured out the key is in on the slice of cake in the dragons stomach then I kept hiding the wall till I was spit out but when I clicked the key on the cage I couldn't free the witch from the bird cage no option after that
After obtaining the key, the character in the cage should mention it when you talk to them. After that, you can just break the cage by hitting it.