The verse permitting temporary marriage was revealed in the Book of Allah, and we practiced it during the time of the Messenger of Allah ﷺ. No Quranic verse was revealed forbidding it, nor did he prohibit it until he died. Then a man expressed whatever opinion he wished.
أنزلت آية المتعة في كتاب الله، ففعلناها مع رسول الله ﷺ، ولم ينزل قرآن يحرمه، ولم ينه عنها حتى مات، قال رجل برأيه ما شاء.
Bukhari related it in the tafsir chapter (4518), and Muslim in the Hajj chapter (1226:172), both from the hadith of Imran bin Muslim, from Abu Raja, who said, Imran bin Husayn said... and he mentioned it. The wording given is Bukhari's, and Muslim's wording is similar to it.As for his saying, "A man said whatever he wished according to his own opinion," it has been said that he meant Umar bin Khattab, who used to forbid Tamattu, so that people would set out to the House both as pilgrims performing Hajj and as pilgrims performing Umrah separately.As for the verse, "for those whose people are not present at Masjid al-Haram" [Baqarah 2:196], the soundest of the scholars' opinions is that this refers to those who reside within the boundaries of the sacred precinct. They are not obligated to perform Hajj Tamattu, and if any of them does perform Tamattu, no sacrificial offering is required of him. Accordingly, the people of Jeddah are not among those present at Masjid al-Haram, and they may perform Hajj either separately or as Tamattu. Whoever among them performs Tamattu must offer the sacrificial offering.