Armies can be upgraded, but for upgrading armies, this can only happen in cities that have the ability to build armies and additionally they must have a building that allows it's city to produce veteran units (Military Academy and Barracks):
https://forums.civfanatics.com/threads/upgrading-armies.642473/#post-15384483
Therefore the AI has no clue how to handle this.
Armies can also be upgraded to normal land units without the army flag and strategy. When this happens, as far as I remember, such an upgrading is
"spitting out" the carried land units inside the army - and now these land units can be upgraded, too.