Sayyiduna Ali (may Allah be pleased with him) said: There is no man on whom I carry out a hadd punishment and who then dies that I would feel any unease about in myself, except (the punishment for) wine; if the drinker dies, I will pay his blood money, because the Prophet (peace and blessings be upon him) did not lay down any (fixed) punishment for it.
What is meant by this, "and Allah knows best", is that he did not lay down more than 40, or did not lay it down with whips, whereas he did lay it down with sandals and the ends of garments to the amount of 40.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / 17549
Sayyiduna Ali (may Allah be pleased with him) said: Among the hadd punishments, whoever dies under the hadd for wine, I feel regret over him, for it is something we introduced after the Prophet (peace and blessings be upon him). Whoever dies from it, I will pay his blood money from the public treasury, or (the narrator is in doubt) upon the 'aqilah (male kin) of the Imam. Imam al-Shafi'i (may Allah have mercy on him) said: It has reached us that Sayyiduna Umar (may Allah be pleased with him) sent for a woman; she became frightened and miscarried. Sayyiduna Umar (may Allah be pleased with him) sought the advice of Sayyiduna Ali (may Allah be pleased with him), who advised him to pay the blood money. So Sayyiduna Umar (may Allah be pleased with him) ordered Ali and said: "I adjure you to distribute it among your people."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / 17550
Abdullah bin Ma'qil (may Allah have mercy on him) said: Sayyiduna Ali (may Allah be pleased with him) had a man given a hadd punishment, and the executioner gave him two extra lashes, so he (may Allah be pleased with him) granted him retaliation against him.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / 17551