Hi Danny! You make very reasonable points.
It certainly could be argued that the referendum was badly set up in the first place. It could quite reasonably be argued that there should have been a two-stage process: First you vote whether to leave and they you get to vote again when a deal has been stuck. And if that had been set out at the time; fine. But setting out the rules of the contest and then retrospectively changing them afterwards is something else.
It is interesting to note that similar criticisms could be made of the Scottish Independence referendum. Perhaps if Scotland had voted for independence, they should have had the chance to set up a new constitution and then they should have had a second vote on whether independence should take place on those particular terms.
I have another article about Brexit and the problem with referendums. You might be interested to read it: