Ireland's Supreme Court decided in 1987 to make a referendum mandatory before they would ratify EU treaty amendments. Not that it mattered, because they got a "no" vote but their puppet masters wanted a "yes", so they just reran the referendum the following year...
https://en.m.wikipedia.org/wiki/Twenty-eighth_Amendment_of_t...
Only 59% turn out, and the vote won 67%. So in reality less than 40% of the population were for it.
I have vague memories of people saying that the treaty was indecipherable. The EU were like, "Here, vote yes for this big bag of 'misc', or else"
This wasn't the first time they reran a referendum for an EU treaty. They did it back in 2003!
https://en.m.wikipedia.org/wiki/Twenty-sixth_Amendment_of_th...
If the UK wanted to avoid BREXIT all they had to do was look a few miles to the west for the knack.