The man who wrote Article 50 has said that Westminster is trying to break the founding principle of the devolution settlement.

Lord Kerr of Kinlochard also said Theresa May could struggle to negotiate a Brexit deal that will win the backing of the House of Commons - which could see the country forced into a general election at the end of next year.

The former diplomat said the UK Government would have to amend key parts of its Brexit legislation because the European Union (Withdrawal) Bill seems to "fly in the face of the devolution settlement".

Both the Scottish and Welsh governments claim the Bill as its stands is a Westminster "power grab", and have put forward amendments they say must be passed if they are to back the process.

Lord Kerr said the "fundamentally important" concept that all powers are devolved apart from those specified in legislation as being reserved to Westminster "has for the first time been broken in my view".

The former ambassador, who was UK Permanent Representative to the European Communities/European Union in Brussels from 1990 until 1995, spoke out as he gave evidence to MSPs on Holyrood's Europe Committee.

He told members that "there will have to be changes made" to the Withdrawal Bill as it goes through the House of Commons this autumn and the Lords in spring 2018.

He added: "Next autumn's drama, autumn 2018, is the deal or no deal. And I cannot now see any negotiable deal for which there is a majority in the House of Commons.

"It seems to me there are sufficient hardline Brexiteers to make it very difficult for the Prime Minister to compromise sufficiently to get a deal in Brussels and if she does these people might vote down her deal."

Kerr continued: "I can see a situation in November/December when the outlines of the deal or no deal are becoming clear - November/December next year - and there will be a requirement for a parliamentary vote, even if it is no deal. At that stage I think we could be quite close to an election."

He told MSPs "the Parliament will not pass, in my judgment, the Bill in its present form which allows the government by statutory instrument to change a great deal without full parliamentary scrutiny".

The devolution settlement on which Holyrood is based is founded on the principle that all powers are devolved, unless they are specifically named as being reserved to Westminster.

Lord Kerr said: "If the UK Government is now saying that on areas like fish and agriculture it needs to retain powers for a period, and might need to change powers for a period, then I think the idea that devolved blocks of subjects, like agriculture of environmental protection, that concept has for the first time been broken in my view.

"That is why I think that bit of the Bill will be changed in the Westminster parliament, because it does seem to me to be fundamentally important."

He said it was "almost 50/50" whether the UK would undergo a hard Brexit, leaving both the single market and the European customs union.

He criticised government ministers, accusing Brexit Secretary David Davis of having "unrealistically" raised the expectations of Britons about the country's future once it leaves the EU and saying Foreign Secretary Boris Johnson was failing to deliver in Brussels despite "roaring like a lion".

Kerr said: "When David Davis says, and he goes on saying, we will enjoy the exact same benefits as we did when we were members of the single market and the customs union, I think [EU chief negotiator Michel] Barnier is quite right to say that that is impossible and [German Chancellor Angela] Merkel is quite right to say it's not feasible.

"At some stage the penny is going to drop, at some stage between now and March 2019 it is going to become clear that Johnson roaring like a lion isn't actually delivering anything in Brussels, and what we were told in the referendum campaign and since about being able to having our cake and eat isn't proving to be the case."

He added that "the longer that moment of the penny dropping is deferred, the bigger the disappointment and the feeling of being let down in this country" would be, although he said "of course it will be blamed on the evil foreigners who haven't given us what we want".

The Article 50 author insisted the deadline of having negotiations completed within two years was achievable - although he said the UK had been "unprepared" when Mrs May formally triggered Brexit by sending the letter in March 2017.

Kerr said: "What I find is odd in our case is that we chose to trigger the procedure without having a clear idea of where we were going to go, we chose to trigger the procedure without having an agreed definition even inside the government of the end state.

"If we were well-prepared, if we had done some preliminary work and been to see some of our friends and partners before firing the gun, if we had an agreed government - or best of all if we had explained that agreed government position to the country and had an agreed national position - then two years would not be too long."

He explained the two-year limit had been put in Article 50 to prevent countries being "forever ensnared in a web of negotiations" if they wanted to leave the EU - going on to liken it to The Eagles' song Hotel California, which famously states "You can check out any time you like, but you can never leave".

He also insisted the two-year transition period, put forward by the Prime Minister in her speech in Florence last month, was merely a "stay of execution".

Kerr said: "I'm sorry to see cheering at the idea of a two-year transition. A transition as discussed so far by the British isn't a transition at all, we don't know where we're going, we don't know where the other pillar of the bridge is, we don't know where we're landing, so we can't build a bridge to it.

"It is not a transition nor is it an implementation period because there would be nothing to implement in the interim. It is a deferral period, a stay of execution. The cliff edge is still there, it just comes two years later."