They’re closing soon
In the very game industry specific time frame of “soon,” gyms in Pokemon Go are going to undergo some changes.
Developer Niantic calls it “remodeling,” and in the meantime said gyms are going to be closed. Niantic cites it as something that they’ve always wanted to improve, which makes sense as they’re all basically dominated by the same power users who have high-level Pokemon. For casual folks they may as well not even exist.
There will be “more to come” on what that alteration entails, but for now just know that they’re going to close up in the near future and any assigned creatures will return to your party. Get ready and grab those last few rewards!