6 months in, you cancel your credit card (or it expires or whatever).
The fact that they can't bill you doesn't change that you agreed to the plan and that you owe the second 6 months anyway. That's a debt and the gym can (and some do!) choose to go after you for it in whatever legal way they feel. That's collection agencies, and direct lawsuits.
An open ended agreement ($10/month for a newspaper) often will have this same style - you agree to pay $10/month for access, they give you access. Valid until cancelled. If you simply ghost - is that cancellation? Probably not, and it's up to the contract. Of course, most consumer things just drop it and shrug, but that is not a given.