Static heavy weapons manned by AI do not fire upon targets at large distances. Even when fired upon by those units. The attacking AI (just infantry) will spot the static defences at a longer range and shoot the gunner, without getting returning fire. Despite the static weapons having all sort of visual enhancement scopes.
In short: AI with optical aids for target spotting and aquisition are actually far worse at spotting and identifying targets than AI without these aids. Even when the enemy passes directly in front of these optic devices.