Hi H,
The only thing I can suggest is that it has some foreign object around its leg that has got caught around the branch when it perched up. I have seen this several times with Feral Pigeon, Blackbird, and Magpie. In every case it involved fishing line tangled around the legs. Bird tries to fly away, can't, ends up dangling until it expires.
Cheers,
Adam