I went on a two year accuracy quest with the .40s&w.
I spent a lot of money I wish I had back. I traded through Sig, Glock and H&K pistols in .40 caliber.
The most accurate pistol in .40 was a Glock 20-10mm converted to .40 with a KKM conversion barrel. Shot several 2-1/2" or less groups at 25 yards.
The next best was the Sig P226 stainless. Great gun! 100% reliable too.
The H&K USP .40 was a very big dissapointment in the accuracy department. 6" groups werew the best I got. Don't get me wrong, I'm a big USP fan, and my USP .45acp is as accurate as it gets, but the .40 just didn't have it. Other USP .40 owners have had the same experience.
I owned a Glock 35 at the same time as the Glock 20- 10mm/.40, but I traded it because it couldn't hold a candle to the 10mm.
I shot a 4" XD .40 that seemed to have excellent potential, but never got to shoot it on paper.
Good luck.