Gunpowder. It was accidentally invented by 9th century Taoist Chinese alchemists for an uncertain purpose (the most popular legend is that it resulted from attempts to create an elixir of immortality).
Whatever the original goal of its creators’ experimentations with combining sulfur and potassium nitrate was, it definitely wasn’t the purpose for which the explosive product came to be used.
Fortunately or unfortunately, gunpowder proved to be much more effective as ammunition than as a potion for eternal life.