Before he secured the job he'd craved for his whole life, the man once seen as the Midas of British politics thought he would burst into Downing Street on a wave of sunny optimism, flip over the table and watch as all the cards landed just where he wanted them.

Instead, the table crashed down on his head.

Barely seven weeks into the job, Johnson has already alienated many of the people he needs onside if he is to achieve his principal goal of getting Brexit done by October 31. He has picked fights with his own party, set negotiating red lines that are unpalatable to the European Union, made promises to hardline Brexiteers that left him with little wriggle room, and threatened to leave the EU without a deal despite the strong objections of Parliament.

His scattergun approach left everyone baffled as to what he actually wants

Most perplexing of all, he even sacked 21 of his own Conservative lawmakers who rebelled against his plans. That Johnson and several members of his own Cabinet took every opportunity to publicly humiliate his predecessor Theresa May has not been lost on his enemies.

Johnson is now trapped in a Brexit prison of his own construction. It's been an extraordinary performance from a man who must have known the scale of the challenge awaiting him.

His biggest headache is that he doesn't have a parliamentary majority. Any Brexit deal must be ratified in the UK Parliament, and even before Johnson sacked 21 of his own rebel MPs, his grip on Parliament was weak. After Theresa May lost her slim majority in 2017, she was forced to strike a deal with the Northern Irish Democratic Unionist Party in order to have enough votes to command a majority for anything, let alone a Brexit deal.

But even the support of the DUP wasn't enough: When May finally returned from Brussels with a fully negotiated deal, the party rejected it. The deal foundered on the rocks of the Irish border backstop, an issue which defies simple explanation but has become totemic for hardline Brexiteers and Northern Irish unionists.

During his leadership campaign, Johnson won over the Brexiteer wing of his party by promising that he would either convince the EU to dump the backstop, or lead the UK out of the EU without a deal on October 31. That's what led to the Conservative rebellion and subsequent sackings. Unless Johnson softens his rhetoric, not only will these 21 continue to defy him, even more Conservatives could walk away.

JUST WATCHED Liverpool resident: Crosswinds of Brexit threaten city Replay More Videos ... MUST WATCH Liverpool resident: Crosswinds of Brexit threaten city 02:14

In recent days, Johnson has toned things down a bit. On a visit to Dublin, he even went so far as to say that leaving without a deal would be a "failure of statecraft," an analysis that many of his MPs share. And he has been more vocal in his optimism that a deal can be done before the next EU summit on October 17.

"If he doesn't get a deal, he's screwed," says one senior Conservative. "And if he doesn't get a deal, then he has demonstrated he cannot negotiate in the national interest."

Let's assume that Johnson manages to achieve what currently seems almost impossible, and strikes a deal with the EU, it's still very hard to see how it gets through Parliament.

Most moderate Conservatives believe Johnson could count on the support of the 21 expelled lawmakers for a new deal. So that's a start.

But any softening on Brexit would pitch the Prime Minister into a fight with the hardliners he spent the summer winning over. And EU diplomats have been clear any new deal would have to achieve the same outcome as the backstop, which leaves the DUP very much in the doubtful camp.

Johnson could look to opposition Labour MPs to get a modified deal over the line. The trouble is, the Labour leadership is focused on preventing a no-deal Brexit by securing an extension to the negotiating process. After that, it wants an election.

Last week, Labour, along with other opposition parties and Conservative rebels, passed legislation instructing Johnson to request such an extension.

Team Johnson has since floated a number of wheezes to circumvent this, from requesting that a friendly EU member state vetoes the request, thereby guaranteeing a no-deal Brexit, or simply ignoring the instruction.

All of this sets up a fascinating showdown when Parliament returns from its controversial suspension (another Johnson tactic that backfired spectacularly , and may yet be overturned in the Supreme Court on Tuesday.) Johnson could credibly say that if lawmakers really want to stop no-deal, they should vote for his modified agreement or face a crash-out October 31.

JUST WATCHED Boris Johnson's call for snap election fails ... again Replay More Videos ... MUST WATCH Boris Johnson's call for snap election fails ... again 03:06

Faced with that choice, Labour would likely hit the nuclear button and seek to bring down Johnson in a vote of no-confidence, and replace him with a new, temporary government with the single purpose of securing a Brexit extension. If Brussels could be convinced that a new election would break the deadlock, they may just agree to it.

Timing becomes an issue here. Any confidence motion would have to be laid after the EU summit in mid-October. If Johnson lost the vote, under UK law he could remain in office for 14 days, after which an election could be held. But that takes the UK perilously close to the October 31 deadline.

Some Labour officials and MPs believe that they could use the 14-day countdown to build a majority in the House of Commons for a temporary government and kick Johnson out of Downing Street.

That would likely need two things: The support of rebel (former) Conservative MPs and the Speaker of the House of Commons, John Bercow. If the rebel MPs could be persuaded to come on board, Bercow would need to facilitate some sort of mechanism to demonstrate that an alternative government could command a parliamentary majority without recourse to a general election.

If that were to happen, it's worth pointing out how utterly unprecedented it would be: A Speaker of the Commons working with the opposition to throw a government from office, while a sitting Prime Minister believes he has a right to squat in Downing Street.

The challenge Johnson faces as he ambles into the toughest few weeks of his life is one of credibility. He has no majority, he has treated his own party with contempt, he has been accused by senior Scottish judges of trying to stymie parliament and it now seems that, after all, he could capitulate and reheat a deal that Brexiteers hate.

And that's just his domestic problems. Just because Johnson believes a deal can be done, that doesn't mean the EU will agree to one. His credibility in Brussels is near enough shot already. "Any change to the deal would need to come with a cast-iron assurance that his parliament agrees to whatever changes he wants to make," says an EU diplomatic source. "How can we trust a PM who doesn't have the trust of a majority of his parliament?"

However, he's not entirely out of options. If he can't get a deal through Parliament, and if he can somehow get around requesting a Brexit extension, then he could kick off the most divisive election campaign in history: Johnson versus the people who stole Brexit. And if he wins an overall majority, he can tell the DUP, his rebels and his hardliners to go to hell.

Or if he can't avoid the extension request, he could get a friendly EU member state to veto it, stare down the Commons and watch as Britain leaves the EU by default on October 31.

Johnson has not completely run out of Brexit road yet. But it must be galling to know that at every turn, he is relying on the goodwill of people who don't have much faith in him.