Getting WD40 onto anything that's going to be painted is very likely to result in problems, but no more so than if oil of the type recommended to lube air tools were to get onto the job before paint was applied.
Anything containing silicone is a quite different matter though, as the silicone tends to remain suspended in the atmosphere in and around the area where it has been used, and will cause all sorts of problems such as fisheyes in the paint over an extended period of time.
So an accurate answer to the OPs question would be give WD40 a try to free off a sticky air tool, but do this outside the working area, and let the tool free run for a while to exhaust all of the WD40, in exactly the same way you would do when lubricating a paintshop air tool with a few drops of oil.
However its certainly a very bad idea to use anything other than WD40 (which contains no silicone), as some products similar to WD40 (GT85 for instance) do contain silicone, and even if the product is exhausted from the tool by free running before use, there is still a possibility of problems caused by the silicone content as outlined above.
Anything containing silicone is a quite different matter though, as the silicone tends to remain suspended in the atmosphere in and around the area where it has been used, and will cause all sorts of problems such as fisheyes in the paint over an extended period of time.
So an accurate answer to the OPs question would be give WD40 a try to free off a sticky air tool, but do this outside the working area, and let the tool free run for a while to exhaust all of the WD40, in exactly the same way you would do when lubricating a paintshop air tool with a few drops of oil.
However its certainly a very bad idea to use anything other than WD40 (which contains no silicone), as some products similar to WD40 (GT85 for instance) do contain silicone, and even if the product is exhausted from the tool by free running before use, there is still a possibility of problems caused by the silicone content as outlined above.