Look at how slow the mobs’ reactions are after using vanish! It takes several seconds for them to finally drop combat.
This is the root cause of the vanish bug - mobs are simply too slow in reacting to vanish, and therefore they keep following you / auto attacking / casting spells and abilities on you for several seconds, despite your being vanished and in an improved stealth.