This excerpt is taken from the book of Sheikh Ghulam Mustafa Zaheer Amanpuri Hafizahullah Difa-e-Sahaba Razi Allah Anhum.
The Punishment for Insulting the Companions:
Allama Sarkhasi Hanafi, may Allah have mercy on him (483 AH), says:
من طعن فيهم فهو ملحد منابذ للإسلام دواؤه السيف إن لم يتب.
"Whoever slanders the Companions is an atheist and an opponent of Islam; if he does not repent, the remedy for him is the sword."
Reference: (Asul al-Sarkhasi: 134/2)
Allama Abu al-Hasan Ali bin Abdul Kafi Sabki, may Allah have mercy on him (756 AH), says:
إنني كنت بالجامع الأموي ظهر يوم الاثنين سادس عشر جمادى الأولى سنة خمس وخمسين وسبعمائة فأحضر إلى شخص شق صفوف المسلمين فى الجامع وهم يصلون الظهر ولم يصل وهو يقول: لعن الله من ظلم آل محمد ويكرر ذلك فسألته من هو فقال: أبو بكر، قلت: أبو بكر الصديق رضي الله عنه، قال: أبو بكر وعمر وعثمان ويزيد ومعاوية فأمرت بسجنه وجعل غل فى عنقه، ثم أخذه القاضي المالكي فضربه وهو مصر على ذلك، وزاد فقال: إن فلانا عدو الله، وشهد عندي عليه بذلك شاهدان وقال: إنه مات على غير الحق وأنه ظلم فاطمة ميراثها وأنه يعني أبا بكر كذب النبى صلى الله عليه وسلم فى منعه ميراثها، وكرر عليه المالكي الضرب يوم الاثنين المذكور ويوم الأربعاء ثامن عشر الشهر المذكور وهو مصر على ذلك، أحضروه يوم الخميس تاسع عشر الشهر بدار العدل وشهد عليه فى وجهه فلم ينكر ولم يقل ولكن صار كلما سئل يقول: إن كنت قلت فقد علم الله تعالى وكرر السؤال عليه مرات وهو يقول هذا الجواب، ثم أعذر إليه فلم يبد دافعا ثم قيل له: تب، فقال: تبت عن ذنوبي وكرر عليه الاستتابة وهو لا يزيد فى الجواب، على ذلك البحث فى المجلس فى كفره وفي قبول توبته ببعض ما تضمنته هذه الكراسة فحكم القاضي المالكي بقتله فقتل.
"Once, at the time of Zuhr, I was present in the Umayyad Grand Mosque. It was the 16th of Jumada al-Awwal, 755 AH, on a Monday. A man (Ali bin Abi al-Fadl bin Muhammad bin Hussain bin Kathir) came to me in the Umayyad Mosque. People were praying, but he did not pray; instead, he broke through the rows and came to me, repeatedly saying: 'May Allah curse the one who wronged the family of Muhammad.' I asked: 'Who wronged them?' He said: 'Abu Bakr.' I asked: 'Abu Bakr Siddiq, may Allah be pleased with him?' He said: 'Yes, yes, Abu Bakr, Umar, Uthman, Yazid, and Muawiya, all of them.' So I ordered that a collar be placed around his neck and he be imprisoned. Then Qadi Maliki caught him and beat him, but he persisted in his statement and even said more. At that time, I had two witnesses present. He said: 'So-and-so is an enemy of Allah and did not die on the truth; he wronged Fatimah, may Allah be pleased with her, by depriving her of inheritance, and he lied about the Prophet Muhammad, peace be upon him, by withholding Fatimah’s inheritance.' He meant Sayyiduna Abu Bakr, may Allah be pleased with him. Qadi Maliki beat him several times that day, then again on Wednesday, the 18th of Jumada al-Awwal, but he remained firm in his statement. Then he was brought before the court on Thursday, the 19th of Jumada al-Awwal, and witnesses were presented against him. He neither denied nor spoke, but in response to every question, he kept saying: 'If I said this, then Allah knows best.' The questions were repeated many times, but he kept giving the same answer. Then he was given the opportunity to present his defense, but he said nothing in his defense. Then he was told to repent, and he said: 'I repent from my sins.' He was repeatedly asked to repent, but he said nothing more than that. In this assembly, there was a discussion about his disbelief and acceptance of repentance, some of which is mentioned in this writing. Then Qadi Maliki pronounced the sentence of his execution and he was killed."
Reference: (Fatawa al-Sabki: 570/2, 571; Al-Bidaya wa al-Nihaya by Ibn Kathir: 561/18)
Allama Mulla Ali Qari Hanafi, may Allah have mercy on him (1014 AH), says:
الكتاب والسنة مشحونان بمناقبهم وفضائلهم، وهم الذين نصروا نبيهم فى اجتهاده، وجاهدوا فى الله حق جهاده، فتحوا بلاد الإسلام، وحفظوا الأحكام وسائر العلوم من سيد الأنام، وانتفع بهم علماء الأعلام ومشايخ الكرام، وقد علمنا الله فى كتابه أن نقول فى حقهم : رَبَّنَا اغْفِرْ لَنَا وَلِإِخْوَانِنَا الَّذِينَ سَبَقُونَا بِالْإِيمَانِ ، وقد ظهرت طائفة لاعنة ملعونة، إما كافرة أو مجنونة، حيث لم يكتفوا باللعن والطعن فى حقهم، بل نسبوهم إلى الكفر بمجرد أوهامهم الفاسدة وأفهامهم الكاسدة من أن أبا بكر وعمر وعثمان رضي الله تعالى عنهم أخذوا الخلافة وهى حق على بغير حق، والحال أن هذا باطل بالإجماع سلفا وخلفا، ولا اعتبار بإنكار المنكرين.
"The books and Sunnah are full of the virtues and merits of the noble Companions. They supported their Prophet, peace be upon him, in every field, waged jihad in the way of Allah as was their right, conquered many cities, and preserved the religious rulings and other Islamic sciences from the Prophet, peace be upon him, from which the great scholars and sheikhs benefited. Allah Almighty has taught us in the Holy Quran to say about them: رَبَّنَا اغْفِرْ لَنَا وَلِإِخْوَانِنَا الَّذِينَ سَبَقُونَا بِالْإِيمَانِ 'Our Lord! Forgive us and our brothers who preceded us in faith.' A cursed group who curse and slander the Companions have become apparent; they are either disbelievers or insane. They do not limit themselves to cursing and slandering the noble Companions but, based on their corrupt ideas and lowly thinking, attribute disbelief to them by claiming that Sayyiduna Abu Bakr, may Allah be pleased with him, Sayyiduna Umar, may Allah be pleased with him, and Sayyiduna Uthman, may Allah be pleased with him, unjustly usurped the caliphate, which was the right of Sayyiduna Ali, may Allah be pleased with him. However, there is consensus among predecessors and successors on the falsehood of this claim, and the denial of the deniers holds no weight."
Reference: (Mirqat al-Mafatih: 3437/8)