As I remember, from being on location shoots, and also working on them, a lot (if not all) of stuff you see in the movies is fake.
(My experience with actual firearms is pretty limited though so I'm not specifically talking about actual 'live' firearms being required 'on set', but other stuff).
As has been covered in Mythbusters, and more recently by Tom Scott, when real stuff is filmed it does not give sufficient 'action' for use in film.
In real life, cars do not explode in a massive fireball when they drive over a cliff, or into a wall, or another vehicle etc etc, this has to specially rigged for films using bags full of gas, or large 'black powder' charges, or a combination of these and/or other explosives.
Similarly, machine guns do not spit out flames and smoke in slow motion, this also has to be created using special incendiary rounds.
A big factor in most films though is budget (or rather, the lack of it) so stuff is done as cheaply as possible to achieve the effect required for the filming.
SFX teams are masters at producing convincing 'visuals' for shots, cobbling together stuff like bits of metal pipe and glued together bits of other tat to resemble firearms of all sorts using a tiny feed of compressed air and coloured powder to mimic shots being fired - if this can be done instead of spending money on actual real live guns without compromising the 'visuals' once filmed, then that is what they will do - it's cheaper and safer.
Careful editing together of filming done from different angles creates the illusion of a real firearm being used when in fact only one close-up of the 'real' gun is used briefly.
I remember working once on a Disney production which IIRC was called 'The London Connection' which was a sort of 'James Bond' type of spy film with guns and cars and gadgets etc. One of the cars used as the 'Hero' car (a term used to define the vehicle that is the good one that doesn't get damaged) was a nice red Jaguar, but there were several 'clunkers' that were identical models which had been salvaged from scrap yards, sprayed up to look good and then variously worked upon to have machine guns hidden behind headlights that moved out the way, and to blow up in a crash etc etc.
Aha - it's on youtube in it's entirety! I had forgotten about the remote control Transit van too! (That just had somebody hiding inside to drive it), ....and the motorbike and sidecar with the rockets.
What a terrible turkey of a film.