Originally Posted by
squid
This is an old bug that has seen a resurgence. So far as I can tell from playing rogue for 5 plus years, it takes NPCs about a second (could be server tick + latency) to accept that you are stealthed. A couple years ago they appeared to have coded in something to tell NPCs to cancel attack on target at stealth cast, which is why you would see pets still chase for a second but not swing or finish a cast, before they'd leave you alone. If I had to guess, I would say that new pets/changes to the pet system in Legion have disrupted this fix.
Report bugs where you see em. Hopefully this time it will take less than a couple years to get round to.