I tested around with the reveal function, and found the following.
Tanks have the MG selected as default on their main turrets. When the commander assigns the revealed enemy tank as target, Gunner does not switch weapon. Commander then gets stuck in a loop ordering to target the enemy tank until LOS is lost, or the front of the hull is turned towards the enemy. Only then (but not consistently on my end) does commander order to switch to main gun.