The 40 S&W was a compromise cartridge designed for a specific era in ammunition technology. It tried to combine the terminal ballistics of the 10mm FBI load in a 9x19 size pistol. It worked pretty darned well, but that time has come and gone. With modern bullets, you can get the 9x19mm to expand to diameters very close to those of the 40 S&W.
You also have a lot more females entering the LEO field and recoil can be an issue, not only for females, but also a good number of males.
With these two things in mind, the FBI switched back to the 9x19mm as its issue sidearm. When the FBI did that, many other federal agencies as well as police and sheriff's departments started dumping their 40 S&W pistols and bought 9x19 pistols.
You also have a lot more females entering the LEO field and recoil can be an issue, not only for females, but also a good number of males.
With these two things in mind, the FBI switched back to the 9x19mm as its issue sidearm. When the FBI did that, many other federal agencies as well as police and sheriff's departments started dumping their 40 S&W pistols and bought 9x19 pistols.