"If at first you don't succeed, change the packaging and sell it as something else."
There are any number of inventions that started off as an attempt to accomplish one purpose, failed but were then realized as accomplishing something completely different. WD-40 is perhaps the most well known (a water displacer), but there are others.
Super Glue - developed to be used for clear plastic gun sites during WWII.
Listerine - surgical antiseptic and treatment for venereal disease.
Kotex - battlefield dressing for soldiers.