The more complexity you give to an AI the more problems you create. The simplest solution would be something like, if an AI has taken 4-5 shots at a single target without hitting any target, either switch target or hold fire. This might even make archers more efficient in sieges, stopping them aiming at a target in an awkward position they can't quite reach. However, that solution itself would create new exploits and problems that you would need to add another layer of complexity to solve.
With a game as sandbox oriented as Bannerlord there is always the option for the player to make the game completely boring for themselves. This is a common problem in game design because people tend to play games in a way that favours a winning strategy over having an enjoyable experience. But we're also kind of lazy, and for the amount of battles in a typical hour of playing Bannerlord, I doubt many people will use this exploit regularly.