Elon Musk never passed a law. The representatives chosen by the voters did. These representatives do not magically enter the government; they are selected by the voters. The voters freely decide wether they wish to have representatives who pass laws which are benefitial to Elon Musk.
> The voters freely decide wether they wish to have representatives who pass laws which are benefitial to Elon Musk.
No, the voters at best select a bundle of stances for/against various things. Effectively this means you have no input except for maybe one or two issues you care most about. In practice you do not even get to do that as your representatives are not bound to what they promised to get you to elect them.
You are free to run as a candidate, even if you are not a well-connected person. (But of course, the voters will choose to not vote for you.)
> Effectively this means you have no input except for maybe one or two issues you care most about.
You are free to vote for someone who fully represents your opinions (yourself). But noone else will vote for that person. Democracy is about making compromises; the government is an average of people's opinions.
> In practice you do not even get to do that as your representatives are not bound to what they promised to get you to elect them.
This is true. But if a candidate lies to you, you can vote for a different candidate in the next election. Repeatedly reelecting liars is a choice voters make voluntarily.
The reason for bad laws is not that democracy doesn't work. The reason is that democracy does work, and other people keep having the wrong opinions ;)