Nobody uses a handgun in Afghanistan. Or anywhere in combat if you can possibly help it. Based off the body camera footage I highly doubt the incident in Kansas was an officer with a handgun either, I think it was a rifle, SWAT doesn't usually use handguns if they can help it.
As for M9s, rather different topic, but I am not much of a fan. M9s account for a huge percentage of military accidental discharges, second only to the M240. The military is buying Sig P-320s now, which I wish they had when I was in, much nicer guns.