UK is a wrong example as their issue wasn't EU's policies but the idea of one Europe. They wanted to have control on the borders that was fundamentally incompatible with EU.
And even then it was based on a misunderstanding of border policy, a false perception of control by the EU. In the years since Brexit all of the issues they had have only worsened and the biggest political agitator now is just the same group that pushed for Brexit with a new name still running on an anti immigrant ticket. Turns out the border problems were policies of their own governments.
I think something that is under estimated is how much it was a matter of identity - do people feel British or European? The areas that voted remain most strongly were the nationalist areas of Scotland and Northern Ireland.