I am a 20+ year police officer and, IMO, the 40 was a "solution" to a "problem" that I'm not sure existed, at least in the LE world.
That said, I am fortunate enough to work for an agency that has a fairly open policy on what you carry to work.
On duty - revolver of American manufacture, or otherwise approved by firearms instructors and armorers, with at least a 6 shot capacity, caliber no smaller (or with less energy than) .38 special +p, a barrel length between 3 and 6 inches, and a minimum of 12 extra rounds in speedloaders. Semi auto pistols of reputable manufacture, approved by firearms instructors and armorers, with a minimum magazine capacity (not including chamber) of 6 rounds and of a caliber no smaller than (or less energy than) 9mm parabellum, no larger in bore diameter than standard .45ACP and a minimum of 1spare magazine. Note on semi auto pistols: smaller or larger caliber pistols may be approved after testing and research by firearms instructors and armorers.
Off duty, the same rules apply, except the revolver may be 5 shots and semi auto may use the lower energy .380ACP. The spare ammo requirement is out here too.
That said, I am an instructor, and the 40 S&W round has done NOTHING for LE but cause more problems than it has fixed. Let's face it, lots of police shootings with the .38, 9, .357 and .45 left lots of folks not breathing anymore. With modern bullet construction, a lot of our people are moving away from the 40.
The 40 was the answer to the 10mm recoil problem. The 10mm was the answer to getting the 357 mag ballistics into an auto pistol..... With that in mind, the 40, in LE loads is abusive to the gun and the shooter. People say "it's snappy". It is, and it does nothing but make recoil sensitive shooters not shoot as well. This is worthless abuse, especially since the return you get ballistically is nothing greater than the 9mm +p or the 45ACP. One with more capacity and greatly less recoil, the other with a bit less rounds (depending on the flavor of the gun) and a "pushy" recoil.
I would much rather have all of my officers hit their target with a lighter bullet than not at all. After all, one well placed shot is infinitely better than any number of misses.
I have never liked the round, probably because I have never seen a true "purpose" for the round since it became the "LE Standard". What I have seen is people who rely on others to tell them "what's good" struggle to shoot it well, all the while time believing it's the end all be all. The LE world, nor the general populus were "under served" by what was available when this "miracle caliber" hit the scene.
As far as "falling out of favor", I suspect it will decline in the LE world to a more equal spot with the 9mm. The 45 (my favorite) will lag behind, but remain mainstream. Among non LE folks, the 40 may become more popular, as there will be a lot of surplus LE guns to be bought and shot. That don't mean it will be the favorite, just the most available.....