Yes, don't do that.
In many ways a gas filter works just like your water filter that takes dissolved chemicals out by activated charcoal. In fact, many filters use activated charcoal. Even if the don't once exposed initially to moisture, you cut the effectiveness of the chemical reactive agent down to as little as hours or at best six months depending on what kind of filter even if you aren't using them but just storing them.
Now on the other hand and once again like your water filter that once the activated charcoal gets coated and stops taking out dissolved chemicals, it will still filter out suspended solids, gas masks when they expire kind of the go the same way. They will typically still filter out suspended particles just not gases.
Now the bad news as it applies to your concern. Ammonia at normal ambient temperatures is naturally a gas. Anhydrous just means there's water. Though it will most likely travel through the air as a vapor as the water evaporates the gas is released.
Long post for better keep the filter in the can.
Tj