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 issue of whether it is permissible for the Prophetic Sunnah to abrogate the Quran is a matter of difference of opinion among the scholars.
Some of them forbade it, such as ash-Shaafi'i, Ibn Taymiyyah, and others . Some other scholars have permitted this, which is the view of most scholars, and this is the view favored by Shaykh Muhammad al-Ameen ash-Shanqeeti.
Then the scholars who are of the view that it is permissible for the Prophetic Sunnah to abrogate the Quran differed in opinion in principle whether it has ever happened that the Sunnah abrogated the Quran, or that it did not happen.
The issue is easy and does not have a significant impact, and this is not the place to elaborate on it.
With regard to the Mut’ah (temporary) marriage, the scholars differed in opinion as to whether it was first made lawful with the verse in Chapter an-Nisaa’ (Women –i.e. Quran 4) and then it was abrogated with other verses or with the Sunnah, or that it was made lawful with the Sunnah and then it was abrogated with it?
Some scholars are of the view that it was made lawful with the verse in which Allah Says (what means): {So for whatever you enjoy [of marriage] from them, give them their due compensation as an obligation.} [Quran 4:24] and then it was abrogated with the verse in which Allah Says (what means): {And they who guard their private parts. Except from their wives or those their right hands possess, for indeed, they will not be blamed - But whoever seeks beyond that, then those are the transgressors.} [Quran 23:5-7]; as well as with verses about divorce, waiting period [after divorce], and inheritance, and other similar verses. However, this view is weak.
The correct view is that the verse in which Allah Says (what means): {So for whatever you enjoy [of marriage] from them, give them their due compensation as an obligation.} [Quran 4:24], does not mean temporary marriage; rather, it means the well-known marriage and the compensation mentioned is the dowry, as in the verse in which Allah Says (what means): {So marry them with the permission of their people and give them their due compensation.} [Quran 4:25]
This is the view favored by a large group of reviewers [prominent scholars who review the Ahadeeth and their chain of narrators].
Based on this, temporary marriage was permitted by the Sunnah and was abrogated by the Sunnah.
In any case, temporary marriage is considered a forbidden marriage by the consensus of the Muslims, except few who contradicted clear evidence.
For more benefit on temporary marriage, please refer to Fataawa 179051, 221503, 83457, 86682 and 90234.
Allah knows best.