Some thinkers often question whether a system of representative democracy will lead to government by meritocracy or mediocrity. None of the later do not necessarily follows from the first. People often chose to be represented by a mixed bag of politicians who may promote merit or ideology.
And that is a positive outcome, because history has shown that the idea that governance by technical experts’ leads to a better society is not only wrong but dangerous. Authoritarian regimes of all kinds, from Bismarck’s Germany to Brezhnev’s Soviet Union embraced the idea that government should be entrusted to trained administrators or engineers but failed to achieve the efficiency success they proclaimed.
As the theory goes technocrats, econocrats and bureaucrats are primarily driven by their cognitive "problem-solution mindsets" and only in part by particular occupational group interests.
That is, they are concerned by the means (efficiency) and not the ends. But here lies the danger of ending up accepting that the end justifies the means.
The engineers that built the gas chambers in the German concentration camps might have devised an efficient way of killing millions of Jews but they did not question that they were committing an atrocity. They probably used the old excuse that they were just following orders.
The fashions about which professional class (engineers, economists, lawyers, scientists, doctors, media professionals, etc.) is better placed to govern may change with the regimes but the problem remains.
The selection of leaders by merit under equal opportunity conditions is a desirable process but only if it does not lead to the creation of a separate cast.
To paraphrase the old say: politics is too important to be left to professional experts.