The person who mentioned equalizing pressure inside and out has it correct.
If the water is surrounding the gun and is also IN the gun, guess what you have?
A different kind of atmosphere.
It's denser than air, it exerts more pressure on the gun & resists the bullet more than air, but it is essentially an atmosphere, and a gun that works in an air atmosphere will most likely operate, at least for one shot, in a liquid atmosphere.
Where you REALLY start to have problems, though, is if you have an air bubble in the barrel. Then it acts like an obstruction, and you're likely going to have problems.