Confirmed for 1.12.1
Confirmed for 1.12.1. Zombies killed me even though I was boxed into a 1x2x1 hole. Hit diagonally through corners.
I'm having this issue mining large mushroom blocks with an axe. It's mainly an issue because it breaks my large mushroom farm - leaving an invisible block means no new mushroom can grow until it's been removed.
This issue has been resubmitted (MC-118546) with a more accurate description of the problem. This report has been marked 'resolved' so you might prefer to follow the other bug report!
I made a similar report recently re parrots (MC-118546). For me nearby sitting parrots start flying if I take damage from a hostile mob.
It's also not just if they are on your shoulder. (Not sure if I made that clear.) If they have been made to sit on e.g. the ground nearby they will also fly if you happen to take damage.
Still in 1.12-pre1
There's a fairly comprehensive explanation of the issue here: https://www.reddit.com/r/redstone/comments/6orbz1/odd_quirk_bug_when_unpowering_a_line_of_powered/