Abu Abdullah Ja’far Bin Muhammad (as) said :
On the Day of Judgement, a caller will call from inside the Throne, “Where is
Allah’s Caliph on His land?” So, Prophet Dawud (as) will stand up. But a Call will come from the side of Allah, the Mighty and the Majestic : ‘We did not Intend it to be you, and indeed you were a Caliph of Allah’.
Then the caller will call out for the second time : “Where is Allah’s Caliph on His land?”
So Amir Al-Momineen Ali ibn Abi Talib (as) will stand up.
Then will be a Call from the side of Allah, the Mighty and the Majestic: “O the group of creatures! This is Ali Bin Abi Talib (as), the Caliph of Allah on His land and His Proof over His servants. So, whoever attached himself to His rope in the house of the world should attach himself to His rope on this Day. He would be illuminated by his (as) light and will follow him towards the highest levels of the Gardens”.
Then Abu Abdullah (as) said: ‘So the people would arise, those who had attached themselves to his (as) rope in the house of the world. They will follow him (as) towards the Paradise’.
Then a Call will come from the side of Allah, the Mighty and the Majestic : ‘Indeed! The one who followed an Imam in the house of the world, so he should follow him to wherever he (as) goes, with him.
166 إِذْ تَبَرَّأَ ٱلَّذِينَ ٱتُّبِعُوا۟ مِنَ ٱلَّذِينَ ٱتَّبَعُوا۟ وَرَأَوُا۟ ٱلْعَذَابَ وَتَقَطَّعَتْ بِهِمُ ٱلْأَسْبَابُ
167 وَقَالَ ٱلَّذِينَ ٱتَّبَعُوا۟ لَوْ أَنَّ لَنَا كَرَّةً فَنَتَبَرَّأَ مِنْهُمْ كَمَا تَبَرَّءُوا۟ مِنَّا ۗ كَذَٰلِكَ يُرِيهِمُ ٱللَّهُ أَعْمَـٰلَهُمْ حَسَرَٰتٍ عَلَيْهِمْ ۖ وَمَا هُم بِخَـٰرِجِينَ مِنَ ٱلنَّارِ
“[2:166] When those who were followed shall renounce those who followed (them), and they see the chastisement and their ties are cut asunder (apart)
[2:167] And those who followed shall say: Had there been for us a return, then we would renounce them as they have renounced us (today). Thus will Allah Show them their deeds to be of intense regret to them, and they shall not come forth from the Fire”.
Ref : Bashaartul Mustafa, Chp.1, H.1