People been calling the .40 dead on gun forums for the last 20 years and yet, here it is, supposedly still dying. Public safety is swayed by a lot of things when they buy equipment, budgets, trends, Union opinions, but to say they have all dropped the .40 in favor of 9mm is simply too broad of a statement. Dont get me wrong, 9mm has come a long way and frankly I love it in my P365, mostly cause I love how the P365 shoots and carrys, but I also love the price of 9mm compared to .40.
As far as ballistic gel, it just that, gel. Wrap some clothing around it and suddenly the 9mm is not as exciting as it once was. Bottom line, you need mass to penetrate clothing, especially for heavier clothing in cold climates and the .45, 10mm, and the .40 have that mass and energy. Dont forget ballistic wise the .40 excels way past 10-15 yards where the .45 drops off.
As others have already stated, you should carry what you have confidence in and shoot well with. Just my .02 cents