The bullet would come out of the barrel instead of the spring guide.
First, what the fucking fuck is up with that cursed-AI image? None of that is even remotely correct.
Second, if the gun goes bang, there’s going to be a muzzle flash. Since the oxidizer is already part of the powder, you’re going to see at least some of that oxidation reaction. Or, you might, depending on barrel length; the shorter the barrel, the more likely it is that you’re going to see that reaction, and a longer barrel might allow all the reaction to complete before the bullet leaves the barrel. (As long as the powder doesn’t get wet, many guns will fire under water at least once.)
Third, and not mentioned, semi-automatic guns likely won’t work without cycling the bolt manually. A gun that is able to move freely–which would largely happen in zero-gravity–won’t have the resistance to the recoil spring necessary to cycle properly. You’ll likely get stovepipes, which is where a casing fails to fully eject, and lot’s of failure-to-feed from the slide not cycling far enough back to pick up a new bullet from the magazine. You’ll frequently see the same thing in novice shooters, or shooters that lack grip or upper body strength; it’s called ‘limp wristing’ (no, I’m not making that up), and it’s literally caused by the gun moving with the slide, rather than the slide moving independently of the gun. Revolvers, bolt-action, breech loading, muzzle loading, and lever action firearms would be fine though, since they don’t require a inertia to cycle the bolt.
Finally, inertia is why you use laser weapons in space. The kinetic energy produced by the stream of photons in even a very, very powerful laser just isn’t enough to have a significant effect on moving a person. :)
In the vacuum of space, the metal in the gun will freeze weld together; there won’t be any mechanism movement.
That only works if both surfaces are polished and very, very flat, like gauge blocks. If you have a film of lubricant, dissimilar surfaces, or small contact points, then that’s not really an issue. Surfaces that have been Parkerized, for instance (which, IIRC, is a form of oxidation, and is a common finish on firearms) are quite rough, and should not freeze weld together. Similarly, a typical mill finish also won’t behave like that.