Sometimes when a pokemon faints right as it starts to use its charge move, the next pokemon that comes in will display that it is using its charge move.
I've read some people claiming that if you do not initiate a quick move for your next pokemon when this happens, then it will actually use its charge move and deal damage, but using a quick move will interrupt this bug. Never been able to replicate this myself though.
A new gym defender switching in like this can also display that it is using its special, but I have never seen one actually deal damage this way.