Yesterday I was driving through the small town I just moved from and I went to take over the few gyms as I passed through.
I got to the 3rd gym (1-2 am mind you) and there were a few people sitting outside on the steps ranking up the gym. I thought to myself, no big deal... they have pretty shitty pokemon in there atm I'll just rank it down fast, throw one in, collect what I had and be on my way. I ranked it down to 1 pokemon left... then all a sudden I lose connection in the game and have to restart the app. -.- well when I go back in, they're already 3 pokemon deep all over again.
SO I start again. Only this time, it would not let me. At first it let me go into battle but wouldn't let me attack so I went out and back in, then it wouldn't let me do anything at all... I checked my actual phone service and it was perfect. I opened up a couple other apps to make sure it wasn't just me and everything was fine.
They seemed to be playing just fine with no issues at all. Was just me, and only with this app.
When I decided to just let them have it and head home, I got out of range of the gym and the app was normal again. (as in no more "no connection" or "trouble connecting" - whatever the error messages say for that. I feel like one of them was using some type of app, or glitch to make it so their gym was untouchable.
I saw they still had it there today when I went back but didn't have time to stop and try attacking it.

not to mention they threw a snorlax in there and I have nothing that can beat a snorlax anyways without it taking a million battles.
TL:DR has anyone else had trouble attacking gyms? losing connection/gps signals while trying to attack? basically making it impossible to battle. Could it have just been bad luck? Level 24 and never had that happen before.