And?
Direct democracies are far worth than representative democracies in practically everyway. The Covid crisis should have made clear to all that people are not policies experts.
Given than no country in the UE significantly uses direct democracy (referendums are pretty much never used and always devolve into a ridiculous race to who can say the most outrageous thing in front of the media), I don't see how that can be leveraged against the institution.
> if they want to be xenophobic, what's the problem?
One of the problems is that even if the majority of people within a country are xenophobic and they get to decide the lays on a majority basis, there will still be people form other countries living there, or people who in general will be disadvantaged by xenophobic laws.
It's nice for laws to not be dictated only by a majority, but by a plurality. Instead of thinking "what benefits >50% of people is the right thing" we can think "what benefits the most people, including minorities", or "what avoids hurting the most people" to be the right things :)
Creating laws based on popularity makes populism rule. Hence why democracy usually has an explicit legislative branch abstracting over individual sentiments. That helps prevent policy from being devised through an overly greedy algorithm.
That is not to say it prevents all these problems. But it evidently helps.
Edit:// the EU or even the US has shown multiple times that it will act against the majority of they can.
Democracy is not majority voting.
Basically it is. You don't need representatives to be democratic.