Praise be to Allah.
The correct view is that it is not permissible to pray against a Muslim if he does not deserve that supplication. The Prophet (blessings and peace of Allah be upon him) said: “Whoever says to a Muslim, ‘O enemy of Allah,’ or prays against him when he is not like that, it will rebound on him.” So it is not permissible to pray against a Muslim if he is not a sinner or drifting away from the path of obedience, or does not deserve that supplication. If someone does that, he may repent by seeking Allah’s forgiveness and by apologizing to that Muslim against whom he prayed and seeking his pardon, and Allah will accept his repentance. The hadith does not mean that he will enter Hell to abide therein forever; rather this is one of the hadiths of warning which forbid praying against a Muslim who does not deserve Hell or to have anyone praying against him, asking that he be admitted to Hell and the like.
And Allah knows best.
Shaykh ‘Abdullah ibn Jibreen (may Allah have mercy on him)