All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The Prophetic narration concerning the virtue of visiting the Prophet's tomb is fabricated. It says: “Whoever visits my tomb shall win my intercession.” Ibn Taimiyyah classified this Hadeeth as weak and unreliable. He said, “there is no known authentic Hadeeth in this matter reported in the Sunan, Masaneed and Musannafat. It was only reported by Ad-Daaraqutni and Al-Bazzar. Its chain of narration is classified as weak.”
Whoever arrives in Al-Madeenah or prays in the Prophet's Mosque is allowed to visit the Prophet's tomb, but he is not allowed to travel for the sake of visiting this tomb or any Prophets' tombs. It is not permissible to travel for visiting places of worship except for the three Mosques: The Sacred Mosque [i.e. the mosque in Makkah], the Prophet's Mosque, and Al-Aqsa Mosque.
Upon this, we can say that whoever visits the Prophet's Mosque in Al-Madeenah is permitted to visit the Prophet's tomb. But, such a visit is not obligatory. And one's ‘Umrah or Hajj is valid and complete even if he does not visit it. None of the Muslim scholars has ever stated that ‘Umrah or Hajj is invalid if the person does not visit the Prophet's mosque or tomb.
As for the afore-mentioned Prophetic narration regarding the virtue of forty prayers in the Prophet's Mosque, it is a Munkar Hadeeth (a Hadeeth that was narrated by a non-trustworthy narrator and contradicts the narration of a trustworthy narrator) according to Shaykh al-Albaani's judgement in At-Targheeb and At-Tarheeb.
For more benefit, please refer to Fatwa 124583, 322780, 355585, and 87191.
Allah knows best.