There is another potential stumbling block for the bill.

The Scottish Parliament’s powers are limited and do not extend to the regulation of “medicines, medical supplies, and poisons” or of health professionals.

As the bill needs both, it will require Westminster cooperation to become law.

The UK government says it is neutral on the matter and has agreed to ensure the Scottish government has the relevant powers over “substances or devices”.

The regulation of medical professionals is trickier.

The draft bill included legal protections for medical staff who do not wish to participate in the process of assisted dying, meaning conscientious objectors can opt out without suffering any detriment.

The UK and Scottish governments have discussed dealing with this problem by means of a transfer of powers known as a section 104 order.

This would require the bill to be stripped of the problematic provisions before it was passed, with MSPs trusting that Westminster would then reinsert them into the act.

Scottish secretary Douglas Alexander signalled that the UK government would be prepared to do so.

But in February, a group of seven medical organisations said this would mean “inadequate scrutiny.”, external

Such matters, they said, “should not be left to a later process in which detailed debate, amendment, and accountability are significantly constrained”.

McArthur said that problem had now been solved by passing amendments to the bill which would prevent it being implemented until protections were re-inserted.

That was welcomed by the British Medical Association but the Royal College of Psychiatrists in Scotland and the Royal Pharmaceutical Society in Scotland said it was not enough.

Both colleges now say they are opposed to the bill in its current form because MSPs will not be able to clarify and scrutinise the exact wording of the protections.

The Royal College of Psychiatrists in Scotland said the development had “drastically weakened essential safeguards” and the bill “now poses unacceptable risks to the general public and the psychiatric workforce.”

The upshot is that after months of careful consideration this bill might fall not because a majority of MSPs oppose it in principle but because the Scottish could not enact it in a satisfactory manner under the current framework of devolution.