There are only a few possibilites, the ammo, the gun, or the interaction between the two.
Test #1
get some different ammo (as many different brands as you can) and runt them through your gun. If you get misfires, its probably your gun that needs work.
Test #2, run the misfiring ammo through different guns, and note the percentage of misfires. (not always possible, if you shot up all the misfiring ammo)
Primers are slightly different. Some makers use thicker, or harder cup material, and it is possible a gun might work fine with Brand A, and C, but misfire with brand B. Its is also possible that a gun can work fine only with a certain brand of primer. I have seen "match guns" set up so that they only work 100% of the time with Federal primers.
A general use gun should fire everything, reliably 100% of the time.
Bad ammo is always a possibility, but a gun that is borderline reliably igniting the primers is also a possibility.
Figure out if its the gun, or the ammo, and also if its ALL the ammo made by that manufacturer, of just the batch you got.
You need to identify the cause of the problem, before you can fix it.
Odds are its the ammo, BUT, one can not be certain without testing.
I would count the service life of your pistol, (number of years/rounds always working with out issues) as a valid test. In other words, if you've shot the gun for years, and never had any misfires, its probably the ammo.