“Flash in the pan”
The first, and, most popular, is that the saying originated from the old flintlock rifle. A flint would strike a plate, and the spark created would ignite gunpowder in a pan. This explosion would ignite the charge in the rifle, and “bang” the bullet would be expelled. It would appear as though this exercise was not always successful. The powder in the pan would “flash”, but not ignite the powder in the rifle. The expectation was there, nothing happened, therefore “a flash in the pan”
The second refers to mining, specifically gold mining. Gold miners in days of old would have a pan would swish water and gravel around in it, trying to separate the gold from the sand. “A flash in the pan” was what appeared to be gold, but on closer investigation turned out to be nothing of value. Again, an expectation that came to nothing.