Please note this is only an issue when an AI group/squad leader/effectiveCommander is assigning the target, if done by scripting it works as intended.
This is a regression that happened around the oldman update (v1.98) and was previously working as intended, similarly the new getAttackTarget command only updates when the unit/gunner is able to fire.
When an AI leader assigns the target to a subordinate, the subordinate engages as desired but assignedTarget will remain <NULL-OBJECT> until the subordinate has fired at it.
getAttackTarget does the same, even if a subordinate is engaging at their own will the script command will ONLY update when they fire at them.
AssignedTarget should update when the commander assigns a target, this is how it worked at least in V1.96 and prior to it.
getAttackTarget should update when the subordinate selects a target to engage at their own will.