Generally speaking the more important an issue is, the less it is allowed to be affected by democratic processes. That's why Brexit was such a big upset, it bucked the trend (the management miscalculated, nobody expected the result and would not have put it to referendum otherwise).
It was virtually 50/50 and should not have proceeded. The bar to leave was set too low. 2/3rd better, and larger turnout should have been mandated. 16 year olds should have voted. The campaign to stay too weak. Mass confusion. Some particularly pernicious lies on the leave side too convincing. Brexit wasn't 100% going to happen, it was more like... Leave 17,410,742 51.89% Remain 16,141,241 48.11%
Also worth pointing out that the hard Brexit we got, where we left Schengen and abandoned much of our cross-European programmes, was almost unthinkable, and not seriously considered by the media. Whenever it was brought up, it was decried as “project fear” by those who pushed for it.