Going to a dying disbeliever to invite him to Islam
(Albani, may Allah have mercy on him) There is no harm in it.
As narrated from Anas (may Allah be pleased with him): a Jewish boy used to serve the Prophet ﷺ. He fell ill, so the Prophet ﷺ went to visit him and sat by his head. The Prophet ﷺ said to him: اسلم “Become a Muslim.” He looked at his father, who was near him, and the father said to the boy: obey Abu al-Qasim. Then the boy became a Muslim. So the Prophet ﷺ went out saying: الحمد لله الذى أنقذه من النار “All praise is for Allah, who saved him from the Fire.” Then, when the boy died, he ﷺ said:
صلوا على صاحبكم
“Pray the funeral prayer for your companion.”