I'm thinking two issues, several possible solutions.
Revolver first. Most common causes are unburned powder under the ejecter star or a bent ejector rod. A good scrubbing will fix the former. A proper fixture, steady hand and good eye are required to fix the latter.
Pistol a bit more puzzling but will go out on a limb and suggest another magazine or a close look at the feed ramp. If the failures happen more often on the last round in the mag replace the spring(s), on other rounds examine the lips.
Life Member NRA, TSRA
Smokeless powder is a passing fad! -Steve Garbe
I hate rude behavior in a man. I won't tolerate it. -Woodrow F. Call Lonesome Dove
My favorite recipes start out with a handful of used wheelweights.