The phrase even a stopped, or broken, clock is right twice a day, and its and variants, mean that anyone can be right occasionally, if only by chance.
This phrase is often used specifically to suggest that one holding a fixed belief regardless of changing circumstances will occasionally, if rarely, be correct.
These are the earliest occurrences of the phrase that I have found, in chronological order:
1-: From an article by the English essayist, poet, playwright and politician Joseph Addison (1672-1719), published in The Spectator (London: England) of Saturday 28th July 1711—as reprinted in the third volume of The Works of the Right Honourable Joseph Addison, Esq (London: Printed for Jacob Tonson, 1721):
Great masters in Painting never care for drawing people in the fashion; as very well knowing that the head-dress, or periwig, that now prevails, and gives a grace to their portraitures at present, will make a very odd figure, and perhaps look monstrous in the eyes of posterity. For this reason they often represent an illustrious person in a Roman habit, or in some other dress that never varies. I could wish, for the sake of my country friends, that there was such a kind of everlasting drapery to be made use of by all who live at a certain distance from the town, and that they would agree upon such fashions as should never be liable to changes and innovations. For want of this standing dress, a man who takes a journey into the country is as much surprized, as one who walks in a gallery of old family pictures; and finds as great a variety of garbs and habits in the persons he converses with. Did they keep to one constant dress, they would sometimes be in the fashion, which they never are as matters are managed at present. If instead of running after the mode, they would continue fixed in one certain habit, the mode would some time or other overtake them, as a clock that stands still is sure to point right once in twelve hours: in this case therefore I would advise them, as a Gentleman did his friend who was hunting about the whole town after a rambling fellow, If you follow him you will never find him, but if you plant your self at the corner of any one street, I’ll engage it will not be long before you see him.
2-: From the second volume of A History of New York, from the Beginning of the World to the End of the Dutch Dynasty (New York: Inskeep & Bradford – Philadelphia: Bradford & Inskeep – &c. – 1809), by the U.S. author Washington Irving (1783-1859):
It is surely more dignified for a ruler to be persevering and consistent in error, than wavering and contradictory, in endeavouring to do what is right; this much is certain, and I generously make the maxim public, for the benefit of all legislators, both great and small, who stand shaking in the wind, without knowing which way to steer—a ruler who acts according to his own will is sure of pleasing himself, while he who seeks to consult the wishes and whims of others, runs a great risk of pleasing nobody. The clock that stands still, and points resolutely in one direction, is certain of being right twice in the four and twenty hours—while others may keep going continually, and continually be going wrong.
3-: From The Camden Mail, and General Advertiser (Camden, New Jersey, USA) of Wednesday 6th November 1839:
The clock that stands still is right twice in every twenty-four hours; but those which, like some people, go too fast or too slow, never can be right.
4-: From the concluding lines of The Dirges of the Whig Administration (London: Whittaker & Co., 1841), by the English banker and politician William Joseph Denison (1769-1849):
Moderate men are even now apprehensive that your successors may be too popular and too strong. They anticipate as much evil, or more, from the despotism of public opinion, when in error, as they experienced from your restraint of it, when it was in the right. The Reform Bill, intended by some of its authors to check or subdue public opinion, has been ineffectual for that purpose. Public opinion has at length triumphed. You have long opposed it. Habit has made you indifferent to the public contempt. Continue to oppose it always. Whenever it is mistaken you will be in the right. The clock which stands is right twice a day. By this means you may begin to serve your country. You are incapable of serving it in any other manner.
5-: The following, from The Bradford Observer (Bradford, Yorkshire, England) of Thursday 30th November 1843, expresses a similar notion—the town of Keighley neighbours Bradford:
The “Clock” Nuisance.—The Bradford clocks which “go,” are often found to be more useless than the Keighley clock which stands still. This is not the first time we have had to direct attention to the clock nuisance, and we fear it will not be the last. But surely there is no insuperable difficulty in setting the public clocks to the real meridian time, or to the Greenwich time, which is exactly 7½ minutes earlier than the time by the meridian of Bradford.