Then nations become stuck with illegitimate leaders. That kind of undesirable stability is called hegemony.
I think these affairs ought to be handled through international bodies. The UN seems to have no mechanism for it.
Unfortunately the non-democratic nations outnumber the democratic nations at the UN: https://en.wikipedia.org/wiki/The_Economist_Democracy_Index
It's why the UN has an obsession with a tiny democracy in the middle east and ignores the multitude of brutal dictatorships which oppress and kill far more people around it and across the globe.
Well, as always, who decides the leader is illegitimate? Are the Saudis illegitimate, according the the rubric we put on Maduro?
The UN deliberately has no mechanism for this because it's a talking shop intended to help avoid war by providing a talking venue. That's the whole idea, they're not the world police, there is no such thing. They're a forum.
I'm absolutely not defending any given dictator but history shows that every attempt to remove a dictator "for the greater good" is usually 1) selfishly motivated and 2) backfires horribly.
Most of the people who make the argument I described probably believe the UN is the only legitimate body that could make this decision, based on some combination of practicality, historical precedent, and international agreement. And the UN absolutely has a mechanism for doing it (the security council). But one alternatively might argue the UN is broken/dysfunctional/corrupt enough that it can't be relied on despite having the "proper paperwork", just as national democracies can be for national affairs.