History has seen its share of mentally impaired monarchs. Some examples from the last centuries include King George III of the United Kingdom, Emperor Ferdinand I of Austria, and Emperor Taishō of Japan. It seems natural (to me, at least) that that insanity is used as an argument against Monarchy, as opposed to a Republican form of government. My question is: was this argument against Monarchy used throughout history? If it was, then when and where it was used?
Mental illness wasn't perceived as a medical condition until recent centuries. It became notional that it might be during the Enlightenment, and it only captured the popular imagination that it was with Freud.
There were still hereditary autocratic monarchies around then, but I'd stick my neck out and suggest that the main argument against them until that point and later revolved around their legitimacy and representativity rather than the off chance a monarch might be mentally unfit.
To the best of my knowledge, when past monarchs were mentally ill, some kind of regent or successor would often step in. Or they'd get deposed or killed, and replaced by someone more fit to reign. Or they'd simply be kept out of sight (Taishō of Japan), sidelined (Charles VI of France), or jailed (Joanna of Castile), while others filled the power vacuum.
The example of Ludwig II of Bavaria, for instance, is instructive. He was an eccentric with extravagant spending habits. This led conspirators to get him certified as mentally unfit to rule -- this was very controversial because they did so without even examining him. His heir was his younger brother Otto. He was considered insane and unfit to rule at the time. So his uncle and cousin ended up reigning instead, until the latter deposed him outright.
The commonality here is that a mad king is temporary state of affairs, perhaps even one that can be exploited by opportunists, rather than a problem that prompts observers to question whether there should be a monarchy to begin with.