The .40 S&W is not "dead". That said, it's popularity has been going downhill for a while now. The reason is because it was a solution to a non existent problem. But in the 90's it was Smith & Wesson's biggest money maker. A Cliff Notes version of the rise and fall of the .40 S&W is as follows:
1.) The FBI Miami shootout occurred on April 11, 1986. Resulting in 2 FBI Agents killed, and 5 others wounded.
2.) In order to improve it's weaponry, the FBI quickly made the change to the then new 10 MM Auto cartridge. Along with the large framed, heavy S&W Model 1006 auto pistols that fired it.
3.) They quickly discovered that several agents, (in particular women agents), could not handle the gun well, and several were having difficulty qualifying with it because of it's size, weight, and recoil.
4.) The FBI then went to Federal, and asked them to produce a reduced power load to help cut recoil, and in the process increase control. Federal then introduced the lower powered, "FBI 10 MM Load". By doing so the FBI along with Federal, managed to create the worst of everything. An underpowered load in too big and heavy of a pistol.
5.) While all of this was going on, Smith & Wesson was sitting on the sidelines watching all of it, and came up with a brilliant, $$$"solution"$$$. They discovered they could shorten the 10 MM case by .100, and call it the .40 S&W. This round gave better paper ballistics then a 9 MM at the time, and could be built on existing 9 MM frame pistols. It was also very easy for police and law enforcement agents to control.
6.) Everyone and their brother started producing and selling .40 S&W pistols. And many in law enforcement and the civilian market thought it was the best thing to come along since Monday Night Football, and 3 men in the booth. Sales took off.
7.) While all of this was taking place in the 90's and well into the new millennium, modern self defense pistol
ammunition was improving drastically across the board. With better, more positively expanding
bullets, that improved the 9 MM's performance to much higher levels. With less recoil and wear than what the .40 S&W offered. Any minor "advantage" the .40 S&W may have had, was quickly negated by vastly improved 9 MM
ammunition
8.) The result of all of this was the .40 S&W slowly fell from grace, while the 9 MM once again began to rise back as the premier caliber for law enforcement.
9.) The final nail in the .40 S&W coffin was when the FBI made the decision to change back to the 9 MM in 2015. Pretty much admitting in the process the .40 S&W did not produce the results they had originally hoped for.
It's not that the .40 S&W was a "bad" cartridge. It's not. Or that there was anything "wrong" with it per say. There isn't. It is just as I said, a solution to a non existent problem. Or perhaps more accurately, a solution to a problem the FBI managed to create for themselves. But that Smith & Wesson was able to brilliantly capitalize on from a financial standpoint.