I've never really believed WD-40 to be a lubricant, except in a short-term "quick-fix" way, despite its manufacturer's claims.
WD stands for water-dispersant, and it will do that, adding a slightly protective but not long-lasting, waxy film in the process.
So I have just looked up its MSDS to find out what really is in it. Not revealed beyond a blend of various petroleum-derived hydrocarbons and carbon-dioxide propellant, their chemical identities being a "trade secret" !
Its problem as a lubricant is that it is of very low viscosity so soon disappears, and in doing so it flushes out any oil or grease already there.