More generally, you lose use of the superweapon if you do not have an adequate number of working military labs. It is not sufficient to have enough labs exist. They must also be online, such that you could currently research the tier on which the cannon is found. You can check this quickly by opening the Research panel and examining whether the tier has a light background or a darker one.
The requirement for the structure not to be disabled can be a problem when facing Vasari players who use their Kostura Cannon to temporarily disable your structures. You need 6 (TEC Loyalist) or 8 (any other faction) non-disabled military (TEC, Vasari) or civilian (Advent) labs. If your labs are disabled due to Kostura fire, you can wait for them to recover (~3 minutes from initial impact) or build spares. For example, if you built a total of 9 military (TEC, Vasari) labs and never had more than one per planet, an enemy would need to hit four separate worlds with Kostura fire to force you down to 5 working military labs.