Why cant I lock ai ships?

For some reason I can hardly, if ever, lock the ai ships in battles. Sometimes I can lock them but, after a few shots, they are unlocked and I am unable to re-lock them. It makes it very annoying to take time to get their range and lead only for that tume to be wasted by it refusing to hold the lock. Why?

AI ships are governed by different rules for some reason. They can’t be locked if there is ANY terrain between them and your ship. By any terrain I mean literally anything. A small sand bank that’s sticking maybe 10 centimeters over the surface is enough to break lock, even if you have perfect LOS on an AI ship from your camera position.