Dear developers, I looked for other tickets like mine, but didn't seem to find anything of the likes. If it is a duplicate, I'm sorry.
I'll picture the whole scenario, so it's easier to replicate.
My pokemon is a choice band Garchomp. I'm against the fire gym, one of the trainers is my adversary. He leads with a Blaziken.
I used dig. Moved first. He used blaze kick and missed. I hit and he survived with a focus sash. I am locked into dig, so I used it again. Then he used hi jump kick and k.o.'d himself due to crash damage, as I am invulnerable in dig.
Here is where the bug begins. Next comes a Delphox, but I am locked under with dig and locked in a loop. My pokemon cannot attack, dig keeps spamming and failing, and all Delphox's attacks misses, since I am invulnerable underground. Garchomp simply got stuck under an invulnerable state since the pokemon he was attacking before k.o.'d himself. I kept going, since maybe Delphox would be k.o.'d due to struggle, but since I'm invulnerable, struggle could not hit and, even without pp, both delphox and I are stuck in loops, none able to k.o. nothing, not even ourselves. Dig failing was infinite, it did not seem to spend PP, probably because of it being stuck with the coice band. Struggle does not have pp, thus infinite.
It may be possible that this bug happens with every 2 turn attack that makes you invulnerable (fly, dive, etc), I only don't know if a choice item is necessary to replicate the bug.
Here is a link to the quick video I recorded showing the loop part. Did not record since the begging, was just playing single player casually.
Video:
https://streamable.com/8t1vj1The only way to stop the bug was (obviously) forcefully closing my game. On reopen, everything was back to normal and I made sure not to use dig against Blaziken again.