I think this also depends on which viewing device the ai gunner/commander/crew are using with the LOS tool. The game is actually using what a vehicle or solider can see. So if the the commander of an AT gun is what is reported by the LOS tool, its not paying attention to what the actual gunners sight can see. Or I guess other members of the crew. If they can see, they can generally still shoot. Or is the LOS tool using what the actual gun location is? In which case, the gunner sight is often above and/or to the side of it. So that would account for that some what.
You sometimes see guns firing into dirt right in front of them as the gun has no clear view, but the sight or crew does. So they give it a go anyways. Hell, sometimes they dig a trench threw the dirt and more morph the land around where the rounds hit.
Then actually do make hits....