I know what the problem is, since I've had it happen to me. When I am being shot at by the thugs, if all of them have shot at me BEFORE I do anything to them, the game treats it as self defense...I did nothing wrong. But, if I take action Before ALL of them has fired at me, then it is treated as a criminal violation. Hope this helps.
"Quote the Raven....."