it's because you're still neutral with the guard that attacked you.

obviously a bug still but if you get friendly++ it won't happen