The two most precise shooting factory guns I've ever had were from a gun company I despise....HK
An USPc 9mm that would shoot groups from a rest at 25 yards you wouldn't believe. However, I couldn't shoot it very well at all in IDPA matches. As precise and reliable as it was, I foolishly traded it for a Rem 700VS.
The 2nd is a P9S Target. Even though it has a 'fixed' barrel, you can still wiggle it when in battery. The muzzle isn't fitted to the slide and there is no bushing (very similar to the muzzle on a Beretta 92FS). Yet the thing shoots 1-1.5" groups at 25 yards. I don't understand it.
My favorite 9mm that fits the bill as a reliable tack driver is my custom built 1911 (McCormick frame, Caspian slide, Barsto bbl). I shoot it the best out of all my 9mms, but from a rest it is on barely on par with the USPc and P9S....definitely no better.