I think it's easy for misconceptions to creep in easily when talking about bullets and calibers, etc. here's a couple to deal with.
Because of how weak handguns are and how they must be used to stop threats in a timely fashion (CNS hits and shots to the heart), the only category that .40 and .45 might offer advantages over 9mm is when dealing with barriers.
This is not necessarily the truth. penetration is dependent on a variety of factors. Bullet construction being one. A bullet built to penetrate deeply will do so regardless of caliber. 9mm ball will penetrate deeper than 40 or 45 jhp provided the latter expands and the medium they have to penetrate. This includes barriers.
Speed helps penetration provided the bullet is built for it. The faster bullet has more energy available to it to use in doing it's work. Meaning that more power helps penetration.
Mass helps penetration. More momentum helps.
The smaller the caliber the less resistance the bullet encounters to penetration. It's easier to push a thumb tack by hand into a board than a large nail. The nail requires more force to do the same thing.
These contradictory factors work together to either aid or help penetration and barrier penetration. So the 40 or 45 don't necessarily penetrate barriers better than the 9mm the 357 Magnum, the 357 Sig or 38 Super, etc.