One of the reasons I can think of is that setting of the gypsum means water is consumed, when water is consumed, concentration of ammonia goes up till solution gets saturated, then bubbles are unavoidable. If that's the case, I doubt there is anything you can do.
Then gypsum may be alkalic for some reason, which will force ammonia out from the solution - same problem as above, although slightly different mechanism.
You may try to lower pH adding acid - but then ammonia will be turned into NH4+, which is a completely different substance, so it will probably change solution properties. Ammonia is usually used to make sure solution is midly alkalic.