I've had my fair share of pristine looking pistols brought to me by academy cadets (who fear "white glove" inspections), reporting assorted malfunctions experienced during their live-fire range sessions. Sometimes it's happened when academy graduates returned and experience malfunctions with their "clean & lubed" pistols when attending their first agency qualification session.
The common denominator has often been along the lines of, "But I used WD40 to clean and lubricate it!?!" When pistols start to heat up after a mag or two, clean/dry guns don't seem to run as well as clean/lubed guns ... or even dirty/lubed guns. Go figure. I cleaned and lubed the guns using one or another of the normal gun products that rotate through the bench ... and the guns suddenly worked as intended.
I use WD40 on some car parts, gardening equipment and door hinges.
Lots of good products being sold for use on firearms. Nice to see some being offered that are less toxic, too. However, you still need to read the labels. Not only for potential safety precautions, but to make sure whatever product you want to use is appropriate for the materials on your firearms (steel, aluminum, wood, plastic, etc).