Matteo Renzi has never seen himself as a short-term prime minister. Months after he assumed power in 2014 in a daring intra-party coup that would have made Machiavelli proud, Renzi addressed the fact that he was the fourth prime minister Italy had seen in three years.

“I don’t know if it’s a good or a bad thing, but I think that you won’t see any more for a few years,” he told the Observer at the time, smiling. The centre-left leader saw himself – and was widely regarded – as a dynamic force capable of reforming Italy after two decades of sclerotic politics. When his Democratic party crushed the opposition in European elections that year, it seemed that – like Silvio Berlusconi, the former conservative prime minister – Renzi would be around for a while.

Today the future looks considerably less bright, and less assured, for the former mayor of Florence. In a few months, probably in November, Italians will head to the polls to vote in a referendum on a constitutional reform that Renzi says will make it easier to pass legislation by dramatically restricting the powers of the senate, a major source of political gridlock.

But whereas as recently as a few months ago a win for Renzi seemed likely, things are suddenly a great deal more complicated. And when the Italian prime minister contemplates the fate of David Cameron, consigned to political history after his own ill-starred referendum, he must feel distinctly queasy.

Much like Brexit in the UK, the referendum is increasingly being seen as a way for Italians to air their general discontent with the establishment, in large part because Renzi swore that he would leave politics if the referendum did not go his way. If he loses his gamble, the results of the referendum could have vast consequences for Italy and the whole of Europe. A defeat could potentially open the door to a new national election that could see the Eurosceptic, populist Five Star Movement push the Democratic party out of power.

“I think, as with every referendum, the Italian constitutional referendum will not only be fought over the substance of the legislation, but a whole number of issues will come to play, and one of those will be the banking crisis,” said Vincenzo Scarpetta, a political analyst with Open Europe.

Italy has been grappling with its troubled banks, whose problems have dominated the news all summer and have provoked worries of a major bank failure. A plan to save the country’s third largest lender, Banca Monte dei Paschi of Siena – which recently found to be the weakest lender in Europe-wide bank stress tests – has not won the full confidence of investors. In order to avoid a bailout by the government, which would have disastrous political consequences for Renzi and potentially wipe out thousands of Italian savers, the bank has found a “market solution”, requiring it to raise at least €5bn in private capital. But there are doubts whether it will be able to convince investors to fork out the capital.

The big question now is whether worries about the banking sector, coupled with anger over the economy’s slow growth and concerns about the ongoing migration crisis, will pose a further risk to Renzi’s chances of winning the referendum in the autumn. One possible silver lining, according to Scarpetta at Open Europe, is that the deadline for MPS to raise the funds will probably fall after the date of the referendum, allowing Renzi to “kick the can down the road” one last time.

Demonstrators protesting over the government’s bank bailout proposals in Rome, which could wipe some savers out. Photograph: NurPhoto/Getty Images

Analysts say one thing is clear: the usually confident Renzi made a big error when he decided to stake his own political career on the vote. Much to his chagrin, the vote is beginning to resemble a national election – something which, thanks to the manoeuvring that got him into power, he has never personally won. In 2014 Renzi elbowed out prime minister Enrico Letta in a tussle for power within his own Democratic party.

“Since he took office in February 2014, his original sin has always been that he never fought a general election,” said Scarpetta. “Now we are seeing a clear change in tack and rhetoric, with him saying ‘this is not Renzi’s referendum, it is just a referendum’. It may be too little, too late.”

If he wins, Renzi will have been chastened but ultimately vindicated by the vote. But if he loses, the reality of Italian politics is that no one is quite sure what will happen. Under one scenario, a caretaker prime minister would take over until the next national election. In another, the president of Italy, Sergio Mattarella, would call new elections, paving the way for a possible win by the Five Star Movement, which has in the past called for a referendum on the use of the euro and is generally Eurosceptic. While the Movement is not considered a staunch opponent of immigration, the party’s founder, comedian Beppe Grillo, has expressed admiration for Nigel Farage, the former Ukip leader, for his stance against Brussels.

Renzi recently acknowledged the risks Italy is facing, telling CNBC: “We’re in a situation where perhaps the Five Star Movement are allowed to lead this country. The people need to understand what voting ‘no’ here means: we learnt that in the UK.”

The prime minister’s big miscalculation, said Scarpetta, was that he believed that the constitutional reform was a top priority for Italian voters who were eager for change. “First, it is clear that for many Italians, the priority is returning to economic growth. The second is that, by personalising the referendum, he has united all the opposition against it,” Scarpetta said.

Gianni Riotta, the former editor of Sole 24 Ore, a leading business newspaper, said he believed Renzi could still eke out a victory. “Yes, I predict he will win, even in this mess,” he said. “I have faith in Italian common sense. Before he wins, he has to fly a little bit lower, eat a little crow, try to mend fences with his former enemies, and realise he cannot do it all alone.”