I have owned two VERY inaccurate handguns over the years. The first was an old Worn Out U.S. GI Remington 1911. The second was a commercial Browning Hi Power.
With the old 1911 I suspect it was worn out to the point everything was loose, or just plain worn out. It would function, but barely stay on a 5 gallon bucket at 25 yards. I am giving it a little slack here, as I am not sure accuracy was even that good.
The Browning Hi Power, I have no idea what it's issue was, it looked in very good condition. I started my Law Enforcement carreer with the Browning. After shooting it, and seeing how badly it shot, and also it did not feed anything that looked very impressive either. I traded it off at the first Gun Show for a S&W Model 28 Highway Patrolman. The 28 was and still is very accurate.
Today 38 years after owning the Hi Power I would venture a guess that it was not locking up the same every shot, probably due to the locking lug fit. The gun was in way to good of shape to have been worn out. Another possible cause was a bad barrel.
That was a couple semi auto examples. I have not owned a revolver so far that had a serious accuracy issue. But, I am sure that is also possible. I have watched a master revolver smith check revolvers out. He checked the cylinder alignment on each chamber with the barrel. Accuracy issues with a revolver can be caused by:
Barrel to Cylinder Alignment
A Bent Crane
The barrel not being square at the forceing cone.
Leaded up barrel
Other issues affecting function.
Guns are a mechanical thing, so they can have issues.
With that said, I will agree with those above who have listed operator issues as the main cause of bad accuracy. I have had 2 inaccurate handguns in the last 42 years, and one of them was a warn out antique. I have probably owned a hundred handguns over that time frame that shot as well as expected.
That is another issue. Expectations.
If you have a S&W 637 and a S&W 27 with 8-3/8" barrel to test fire side by side. Guess which one will perform best?
How about a cheap entry level 1911 and a Wilson Combat 1911 built for target shooting. The entry level gun may shoot OK, but the Wilson Combat is going to smoke it on accuracy if the operator can shoot. Now if the operator cannot shoot, neither will shoot well. But if the operator can shoot, we are back to expectations. You cannot expect a cheap gun to be a tack driver every time.
I mostly own revolvers at this point in my life. I have 2" J Frames, 2-1/2" & 4" K Frames, 2-1/2", 3", and 4" N Frames, and 7-1/2" & 9-1/2" Super RedHawks. I do not expect the same level of accuracy from them.
A 3" group at 25 yards off sand bags is a very good group with a snub revolver. The Super Redhawk will do that at 100 yards with no problem.
My point is, you do get what you pay for to a point. Do not expect a $200 gun to shoot with a $600 one.
If you are not a skilled handgun shooter, and you are having an accuracy issue with a handgun, let someone else shoot it that is capable of shooting a small group. If you have a quality handgun, letting another shooter try it out will be a very good starting point to determine where the problem might be.
Just My 2 Cents
Bob