That, at least, is the story a lot of people are expecting to tell of today’s events in Brussels. All the signs are that Mr Cameron will indeed be beaten, defeated, outvoted and outgunned as Mr Juncker gets the nod from Angela Merkel and the rest.

But here’s the funny thing. Mr Cameron doesn’t look like a man who thinks he’s losing. He looks distinctly chipper. Is the PM mad? Deluded? Both?

Actually, he’s probably neither. His optimism about his European defeat may well be rational and justified.

Since he became PM in 2010, Mr Cameron has spent a lot of time talking about Europe, and taken a variety of positions, most memorably on a referendum: he was against it before he was for it, to borrow from John Kerry.

But amid all those European gymnastics, Mr Cameron has only pulled off one manoeuvre that voters really noticed and liked: in 2011, he “vetoed” an EU treaty taking the eurozone towards a debt union.

I use those quotation marks because the treaty still went ahead, it just didn’t include Britain. To diplomats and political anoraks, that distinction mattered a lot; many such folk still regard that moment in 2011 as a terrible blunder, a mistake for which Mr Cameron is still paying, not least over Mr Juncker.

British voters took a rather different view. Whether the veto was real or not, whether it was diplomatically prudent or not, they liked it. It was popular, probably the only truly popular thing Mr Cameron has done in Europe since taking office. YouGov found that the PM had 58 per cent – 21 per cent backing for the veto. Most people – 53 per cent to 17 per cent – thought Mr Cameron’s “isolation” over the treaty was a sign of strength, not weakness.

All this informs Mr Cameron’s enthusiastic embrace of his “defeat” today. Remember that this very visible setback was something he initiated: he is forcing a formal vote on Mr Juncker where he can noisily register this opposition.

Instead of accepting the sort of closed-door consensus deal that usually ends EU rows, the PM will present himself as a leader prepared to fight the good fight, even if that means paying the price for his principles: what could be more British?

Mr Cameron is betting that, far from agreeing with pundits who talk about diplomatic miscalculation, voters will admire and respect him for taking a stand in Europe, even if it’s a doomed one.

In certain Tory circles, there is already talk of Mr Cameron and the party enjoying the sort of mini-bounce in the polls that came after that 2011 veto.

Indeed, some Tories are even talking about Mr Cameron using such a bounce to leap into a reshuffle of his Cabinet next week, including the symbolic purging of Kenneth Clarke, the last remaining pro-European at the top table.

Now, it would be silly to suggest that things have turned out according to the PM’s plan today: he would surely have preferred to block Mr Juncker, and be celebrating that victory instead. No, this wasn’t the plan. But since things have turned out this way, Mr Cameron is doing something he does quite well: improvising. Faced with imperfect circumstances, even ones partly of his own making, Mr Cameron has a knack of making the best of them anyway.

Now, making things up as you go along might not strike some people as the ideal approach to the premiership. But bear in mind the light-footed approach has brought Mr Cameron a long way so far: in only a few leaps, he made it from being an overconfident Brasenose undergrad who dashed off first-class essays minutes before deadline to being the Tory leader who failed to win a Commons majority but then scratched together a coalition deal that gave him five years of remarkably stable government anyway.

Mr Cameron’s attempt to turn European defeat into domestic victory can be called many things. Audacious? Certainly. Short-termist? Probably. But effective? Quite likely.