You've found a bug, quite clearly.
I agree that the behaviour should be expanded as to keep the infrastructure in combat also if it has "offensiveAttackAA" and for as long as specified in "maxRoundsAA", where "-1" means infinite. I encourage you opening an issue in GitHub, about that.
I've tested that it works fine when the AA gun is in defence, thus this behaviour is surely meant to be supported, and this limit must really be a bug (so, it should be reported).
Meanwhile, until a developer will eventually allow it to work properly, you can hack your way through by using a support 0 to itself; that will keep the unit in combat. For example:
<attachment name="supportAttachmentAnti-AirOffend" attachTo="Anti-Air" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
<option name="unitType" value="Anti-Air"/>
<option name="faction" value="allied"/>
<option name="side" value="offence"/>
<option name="dice" value="strength"/>
<option name="bonus" value="0"/>
<option name="number" value="0"/>
<option name="bonusType" value="Anti-AirOffend"/>
<option name="impArtTech" value="false"/>
<option name="players" value="Russians:Germans:British:Japanese:Americans"/>
But, especially if that "Anti-Air" is representing stuff like the German 88 mm or the Italian 90 mm etc., then I strongly suggest you having actual attack and defence powers (more defence than attack) for it, and it being a true combat unit, not an infrastructure, as such guns were really fully able to work very well both as field artilleries (with regular HE shells) and as anti-armour guns (with AP shells); you can really think to such kind of guns as to anti-armour guns, having all the abilities of dedicated anti-armours, as well as field artilleries, but costing a little more and being also able to target aircrafts, as an additional ability.
If the "Anti-Air", instead, is representing fast-firing 12 to 40 mm guns, those are more specialised for the role, but they have still a good value against land targets, basically working as very heavy machine guns, and very powerful in taking out lightly armoured vehicles, like armoured personnel carriers or armoured scout cars.
Also, I really don't like the name. "Anti-Air" what? I would end it in "weapon", "gun", "cannon", "autocannon" or something, mainly depending if it is representing the medium (like the 88 mm) or the small (like the 40 mm) AA cannons. Just a suggestion. Or maybe it is called just "Anti-Air" because it is representing whatever AA stuff, like also barrage balloons?