There is nothing wrong with what you did, because when you travelled to Jeddah you were not intending to do Umrah, so you did not have to enter ihraam at the meeqaat when you passed it. Rather you intended to do Umrah from Madeenah, so you had to enter ihraam from its meeqaat (Dhu'l-Hulayfah).
Shaykh Ibn Uthaymeen (may Allaah have mercy on him) was asked: A man came from Jeddah and did not enter ihraam. First he went to al-Madeenah al-Munawwarah to visit the Prophet's Mosque, then he entered ihraam from the meeqaat of the people of Madeenah. Is this correct?
He replied: There is nothing wring with it, i.e., if a person comes from his country intending to go to Madeenah first, and he stops in Jeddah, then goes from Jeddah to Madeenah, then comes back from Madeenah, entering ihraam from the meeqaat of the people of Madeenah, there is nothing wrong with that. End quote. Liqa' al-Baab al-Maftooh (121/29).
He was also asked about a man who came for Hajj and his meeqaat was Yalamlam, but he did not enter ihraam from the meeqaat, and he stopped in Jeddah, and went to Madeenah to visit it, then he came back to Makkah and entered ihraam from Dhu'l-Hulayfah. Does he have to do anything?
If he was originally heading for Madeenah, then he came back and entered ihraam from Dhu'l-Hulayfah, then he does not have to do anything. End quote.
Majmoo' Fataawa Ibn Uthaymeen (21/345).
Prayer in al-Masjid al-Haraam is better than prayer in al-Masjid al-Nabawi, because the Prophet (peace and blessings of Allaah be upon him) said: One prayer in this mosque of mine is better than a thousand prayers in any other mosque, unless it is al-Masjid al-Haraam. Narrated by al-Bukhaari (1190) and Muslim (1394). This includes Jumu'ah and other prayers.
And Allaah knows best.
Reproduced from Islam QA