There's a known glitch whereby a bounty is recognized by every "law enforcement" faction in a hold *except* the guards. The Jarl and his court will then attack you on sight, some of the Companions may do the same if they see you. But the guards just don't care which leads to the problem of not being able to clear the bounty. I had this happen to me both in Whiterun and Windhelm.
The fix I used was to go up to a guard in the hold city where I was having the problem, engage him in conversation, then disengage and go into sneak mode and try to pickpocket him while he was looking right at me. The guard would then go into the usual routine they have when you are caught red-handed doing something, and give me the usual options for clearing my name. If you pay the bounty (and I suspect doing the jail time would also work) for the crime the guard just busted you on, it clears your bounty in the hold. In full. Which means the "hidden" one that the Jarl and his posse reacted to is cleared as well. Problem solved.
You don't have to do the pickpocket thing, any small crime done in front of a guard should work. Anything to make them try to arrest you and give you the options you need. Just make sure you have the money on hand to actually pay whatever bounty you end up with, unless you don't mind doing the time and losing any stolen merch you have on you.