If you try changing your gamemode when looking through an entity's camera, it will cause a strange behavior.
For example, try looking through a creeper's camera, then do /gamemode creative. You'll remain into the entity's camera and only the held item will be rendered (in a strange way) until you press SHIFT.
If you do the same with /gamemode survival, the held item and the XP bar (not the levels number) will be rendered until you blow up and when you respawn the creeper.json filter won't be removed unless you use the Super Secret Settings button.
Linked issues
Comments


That's what I meant...there is a really strange behavior. You can try, for example, going into spectator mode and look through a creeper's camera: if you do /gamemode survival you'll die, but the green pixelated filter will remain.

Duplicate of MC-46410

I'm also talking about survival mode here, maybe you could merge the two issues.
Cannot reproduce, changing the gamemode inside an entity causes strange behavior, but it worked.