(Somewhat related: Anyone who complains about the 'undemocratically elected' Tories is compelled by consistency to complain about the 'undemocratically elected' Labour government of Tony Blair and the likely forthcoming 'undemocratic' government of Kier Starmer. If they are quiet about that, then they haven't a leg to stand on. See also complaining about the results of the Brexit Referendum, which won a clear, although narrow, majority of the people who bothered to vote, and was therefore legitimate by the lights of people who prefer majority decisions.)
A government formed through negotiation is more democratic if you accept that a representative government can ever be democratic and that the parties actually represents the interests of their voters in as much as if neither party achieves a majority, then a compromise that provides for some of what is wanted by all is more democratic. If anything, I'd argue the broader coalition the more democratic - democracies are best measured by how well they ensure also the interests of the minorities are protected.
The social contract isn't to be "only be ruled by a strict majority" but to agree to be ruled by the party who wins by any workable system.
A system imposed on people which denies them representation has no claim to be considered democratic.
The primary goal isn't to represent, but to reduce misrepresentation to the point where we can literally live with it.
To me it's only illegitimate if this is coupled with unreasonable attempts to keep us from improving the system as technology and knowledge give us the means.