The quote is true to Bacon’s thought, and its expression much improved in the repetition. Here is the nearest to it I can find in Bacon’s works on Gutenberg:
For this purpose, let us consider the false
appearances that are imposed upon us by the general nature of the
mind, beholding them in an example or two; as first, in that
instance which is the root of all superstition, namely, that to the
nature of the mind of all men it is consonant for the affirmative or
active to affect more than the negative or privative. So that a few
times hitting or presence countervails ofttimes failing or absence,
as was well answered by Diagoras to him that showed him in Neptune’s
temple the great number of pictures of such as had escaped
shipwreck, and had paid their vows to Neptune, saying, “Advise now,
you that think it folly to invocate Neptune in tempest.” “Yea,
but,” saith Diagoras, “where are they painted that are drowned?”
“The root of all superstition is that men observe when a thing hits, but not when it misses”
-- Francis Bacon
https://www.goodreads.com/quotes/5741-the-root-of-all-superstition-is-that-men-observe-when
The quote is true to Bacon’s thought, and its expression much improved in the repetition. Here is the nearest to it I can find in Bacon’s works on Gutenberg:
Francis Bacon, “The Advancement of Learning”