All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
The abstract of the incident you are asking about is that when the Prophet, sallallaahu ‘alayhi wa sallam, fell extremely ill before his death, he commanded a group of the Companions, including ‘Umar ibn Al-Khattaab to fetch him a paper to stipulate certain rulings, so that Muslims did not differ after his death.
It is also said that this paper was meant to assign a caliph after him. The latter is supported by a Hadeeth narrated on the authority of ‘Aaishah that the Prophet, sallallaahu ‘alayhi wa sallam, asked her to call Abu Bakr and her brother so that the Prophet, sallallaahu ‘alayhi wa sallam, could write a commandment for the caliphate to him. By that, the Prophet, sallallaahu ‘alayhi wa sallam, wanted to prevent the differences that might arise among Muslims. When the attendants differed on fulfilling this requirement the Prophet, sallallaahu ‘alayhi wa sallam, he ordered them to leave. [Muslim].
It was reported on the authority of Ibn ‘Abbaas that when the Prophet, sallallaahu ‘alayhi wa sallam, fell very ill he asked for a paper to write certain things for Muslims, after which they would not differ. ‘Umar ibn Al-Khattaab said that the Prophet, sallallaahu ‘alayhi wa sallam, was too sick (to do anything) and that they had the book of Allaah the Almighty anyway. The companions disagreed and there were many opinions; then the Prophet, sallallaahu ‘alayhi wa sallam, then ordered them to leave as disputing in his presence is something prohibited. [Al-Bukhari].
This indicates that there were two groups: a group who wanted the Prophet, sallallaahu ‘alayhi wa sallam, to write the instructions, while another group, including ‘Umar ibn Al-Khattaab were reluctant out of sympathy for the Prophet, sallallaahu ‘alayhi wa sallam, and because they understood that this demand was not meant as an obligation, but as a directive and advice, and this is the saying of the Shaafi’i scholar Ibn Hajar and the Maaliki scholar Al-Qurtubi .
It should thus be clear that claiming that the Prophet, sallallaahu ‘alayhi wa sallam, wanted to assign ‘Ali as a caliph after him is invalid. ‘Ali was not mentioned in this story at all. It was Abu Bakr whom the Prophet, sallallaahu ‘alayhi wa sallam, wanted to assign at the beginning of his illness, as explained in the previous Hadeeth of ‘Aaishah .
Allaah Knows best.