weaponType = [[LightningCannon]]
This is the weapontype of Knight's lightning cannon, and it's probably important when looking into how a unit behaves with their weapon, because different engine weapon types can act differently.
In this case, however, it appears that knight will act the same as units with other weapon types, such as BeamLaser and Cannon: When a unit is given a fire-at-ground command, and the unit is standing within range of the target, the unit will not pathfind but allow the weapon to target the position. However, when the weapon is obstructed by terrain, the unit will do nothing. See Image 1 below.
Default unit AI appears to work for me, in that when an enemy unit is nearby in LOS, Knight/other units will attempt to pathfind towards that unit around obstacles until it can shoot.
In my testing, there can be a little bit of jank with that pathfinding. One time the knight had a very obvious line of fire but would not move or attack. A semi-common situation is knight barly peeks over a wall and then freezes in place, but it's ambiguous if there is a clear line of fire. But there's many places this could be starting from: Knight's aimFromWeapon position is off-center of the model positioned on the gun by the grip, meaning it moves a bit while walking and aiming. I don't know the specifics of how LightningCannon aims(There are subtle differences between weapontypes). And there's probably others, like unit AI's attempt to kite.
I'm willing to blame some archaic logic related to weapon aiming in the engine.