I noticed something interesting today. There were the family of three deer. I killed two but someone killed the third. All three agro-ed me because I shot first. I was then locked in combat after the third had died and had to kill something else to get out of combat. I am not sure if this is a one time thing or a reproducible but this could be one reason why you get locked in combat somethings.
That’s a common bug that’s being tracked and worked on. In the options/settings menu there’s a “Stuck Combat” button that may solve the issue. Otherwise, like you noticed, killing something will get you out.
Stuck in combat button never work for me. Killing the other did.