This is an interesting thread, which I initially missed earlier this year. A few statistics, such as gun shop sales and LE agency current issue/approved handguns, are not the end-all determiner of a handgun cartridge's "demise" or obsolescence. A cartridge can maintain popularity in the civilian world, even without high-volume gun store sales of new guns in that chambering. Some LE agencies have moved away from using .40 S&W, where others have retained its use to this day.
As for the .40 S&W cartridge itself, I have never purchased or desired a handgun in the chambering. I am not an active LE agency official. I do have some formal LE training from my earlier years in the fire service, with most of it being on firearms, investigation, and driving. I do not carry a sidearm for any of my fire investigation duties. So for me, handguns are for home/personal protection and sporting purposes. The .40 S&W doesn't fit in to those categories for my needs. I enjoy firearms, but I don't care to purchase and collect multiple versions of the same gun. I have 25 guns (14 long guns), but only three are centerfire semi-auto pistols: A S&W 908 9mm, an Auto Ordnance M1911A1 .45 ACP, and a Seecamp LWS32. I did have a Colt Officers ACP (3.5" bbl, six-shot .45 Auto) decades ago, but it was not pleasant to shoot much. I do have four centerfire revolvers and two blackpowder revolvers, though. I also handload virtually all of my metallic cartridge ammo, except rimfire and .32 ACP.
I am not the person that cares to be or needs to be a .40 S&W owner, and that's where I leave it.
That 908 is a dang near perfect SD handgun.