Cameron put the referendum in the Conservative manifesto because he thought that they wouldn't get a majority, and then oh tit, they did. He then assumed that people would be sensible and vote to stay, forgetting that half his party and newspapers that support him had been implying that the EU was the most evil organisation on earth, so then it was (with the benefit of hindsight) inevitable.
The problem is that now we have got ourselves in a mess. Johnson has tried a) threats, b) smears, c) tried to annoy them enough that the EU will walk away.
a) Threats don't work - i.e. sending in the 'gunboats' as we only have 4 patrol boats to guard the coast from Land's End to John O'Groats, and do you think Biden will allow that the happen? Also, the french have been helping us out with the russians going down the coast.
b) Smearing Macron and Merkel, neither could give a toss about what Johnson and the British think of them, if anything it helps them electorally.
c) Johnson knows he has to get something, and the EU know it. He thinks he can play chicken with the EU, but he's a space hopper and they have a euro-juggernaut. They can keep going as long as they want.
I bet the EU offers another transition period, and if they do, Johnson is in the tit. He can't walk away as he knows he would be held personally responsible for the chaos following, the ERG will demand a no-deal and may do a vote of no-confidence in him, and he wants to have a great triumph and be remembered as a great Prime Minister.
Johnson really is an utter curd.