My favorite example of the evidence that democracy does not do a good job of producing laws is the example of tarifs - taxes on imports. It was a well accepted XVIIIth century doctrine that the way a country got rich was to export more than imported. This was one central argument of what was called "mercantilism". This position was persuasively attacked by Adam Smith in 1776 and utterly demolished by David Ricardo about forty years later. When Ricardo worked out, what is still regarded as a correct economic analysis of foreign trade - something called a principle of comparative adage (...). So it has been about two hundred years since there was a defensible economic argument to show that a country is better off with tarifs. And during that period of time off-hand I can only think of two places (one of them not a country) that actually had a free trade - England in the XIXth century and Hong Kong in the XXth century. They were both spectacularly successful economies. Hong Kong went from being dirt, poor and ten times as density populated as the most density populated country in the world, to being richer than England. And they did it in about thirty years. Nonetheless you observe that the US still has tarifs. That essentially all countries have tarifs. This suggests that whatever has generated the laws it is not a mechanism for getting the right laws, the laws that make the population as well off as possible.

David Friedman "A Consequentialist Theory of Anarcho-Capitalism"