I've shot guns my whole life. I'm pretty good with a rifle and a shotgun. I can't hit a damn thing with a pistol. That's the biggest reason I don't have a carry permit or own any. I would have better luck throwing it at them than shooting it at them.
I have never done this, but I have heard of a technique where you let someone else load up the magazine, and at a random spot in the load, place in a dummy round. This will let you see if you are pulling on the trigger too hard or anticipating recoil, etc, which all cause your aim to be way off. I generally have a good grouping, but it is always, no matter the gun, down and to the left about 6 inches, from center.
Consistency is the key to tight grouping. Everything from trigger pull to sighting must be the same to develop muscle memory. It is better to have a tight grouping six inches off than to be all over the target. Like BPV said, it is easy to fix that.