Changing the ActiveEffects tag of a mob does not update the potion effects. This means for example that mobs won't become invisible instantaneously.
Tried using /effect and it works properly
- Summon a couple of creepers in a world
- Give them invisibility with:
Some (maybe all) of them don't disappear.
Re enter your world; now they've disappeared.
The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
The problem is that when the ActivePotionEffects tag is read, the method net.minecraft.entity.EntityLivingBase.markPotionsDirty() is not called if the tag contained potion effects.