In my case, I had a group of Iron Golems attacking a Warden in Creative Mode. I was healing the Iron Golems with iron ingots, and during the fight, the Iron Golem started glitching out by violently shaking while being coloured red.
My guess is what has happened is that I healed the Iron Golem on the same frame or tick that the Warden attacked it, meaning it didn't know whether to be healed or die. I couldn't interact with it afterwards and it wouldn't take damage, but it still would behave normally in other manners - e.g. it would still attack hostile mobs.
It's probably worth noting that I was on Experimental Gameplay. However, only Spectator Mode was enabled, so I doubt that that affected this in any way.
Link to video that displays this bug and what caused it:
https://youtu.be/iT6UqwsJwL4
Thank you for your report!
We're tracking this issue in MCPE-99884, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki