You see an enemy using a siege weapon* & you put your cursor on him, only your cursor only picks up the siege weapon and at that point you can't target any enemies at all. You have to hit escape in order to clear the problem.
*Actually, the enemy doesn't even need to be on the siege weapon, just near it and you cursor will lock onto the siege & not the player.