I have been "caught" at stage 4 since always -- that is, Minthara and pretty much everyone turns permanently hostile, even if I'm not seen. No war drum needed. They also know where I am. It doesn't seem to matter how they're attacked, but it's been very, very long since I last tested this. Maybe it changed. I definitely haven't been arrested in my recent playthrough, and I killed Minthara with Halsin before Ragzlin. If you do it in this order, Ragzlin and company are guaranteed to spot you through the broken wall, if not as soon as you open the door (attacking Minthara also turns everyone hostile for me).
However, you are not the first person to report this bug this month. People have been getting mysteriously arrested when seemingly unseen. In my case, they don't even try to arrest you, unless you fail to deal lethal damage.
Coincidentally, attacking Ragzlin did attract those 3 goblins in my playthrough immediately -- no war drum needed. However, I didn't think much of it since Minthara was already dead. They're usually perma hostile, but don't necessarily notice an attack on Ragzlin, depending. This link could go both ways.