Constantly getting attacked by city gaurd without a bounty

Ok so after doing a couple of side quest I decided to return to rattay to sell loot, repair armor, etc. Everything is normal until I walk near the Rathaus and suddenly I hear a guard going “what was that?, Who’s there” all of a sudden a random guard charges me and start swinging at me with his fist I keep surrendering but he wont accept my surrender. After trying to surrender I fight back and then all the other guards join in using weapons I surrender but the wont accept eventually I just run away I reloaded the game after saving at the rattay bath house but whenever I go near the rathaus I get attacked again. Please help what do I do? edit I thought about it and the only thing I can think of is that several hours earlier I beat up a rattay guard during the bath house quest with hans capon but I had paid my fine since then so I don’t know what’s happening

I ended up killing the specific guard causing the problem and no I think im good but I lost 600 groschen and had to be imprisoned for 10 days please fix this Warhorse

The problem with killing npcs is that they respawn. I have the same problem with a townfolk that I robbed. Everytime I go to rattay he calls for a guard even after I do jail time; which also effects my reputation.

huh for me it worked probably because he was an unnamed guard