One is a complete failure, either apparent from the beginning or something that appears promising but turns out to be disappointing or worthless. A misfire, on a musket's priming pan. A fool's gold
And another is apparent success, though quickly faded, a thing or person whose sudden but brief success is not repeated or repeatable. A grain of gold in the prospector's pan, bit gold nonetheless.
To me it's quite opposite meanings. A misfire is not a success in any sense. A one-hit wonder is, despite being short-lived. Am I right that it's two different meanings? Or may be I am emphasizing too much the success part while it's the failure in the end that makes all the meaning?
Still it's rather hard for me to make a "one-hit wonder" from a misfire which is suggested as the origin in many sources (including MW by the link above). A misfire is a failure, not a success.
Could it be possible that there was actually two origins? Or, even initially being derived from muskets, it appeared to people as a reference to prospector's pan, and so the common understanding shifted from "complete failure" to "quick but shortly-lived" success?