Muhammad the messenger had only a single mission, which was to deliver the message.
[16:82] If they still turn away, then your sole mission is the clear delivery (of the message).
فَإِنْ تَوَلَّوْا فَإِنَّمَا عَلَيْكَ الْبَلَاغُ الْمُبِينُ

[5:92] You shall obey GOD, and you shall obey the messenger, and beware. If you turn away, then know that the sole duty of our messenger is to deliver the message efficiently.
وَأَطِيعُوا اللَّهَ وَأَطِيعُوا الرَّسُولَ وَاحْذَرُوا فَإِنْ تَوَلَّيْتُمْ فَاعْلَمُوا أَنَّمَا عَلَىٰ رَسُولِنَا الْبَلَاغُ الْمُبِينُ

[5:99] The sole duty of the messenger is to deliver the message, and GOD knows everything you declare and everything you conceal.
مَا عَلَى الرَّسُولِ إِلَّا الْبَلَاغُ وَاللَّهُ يَعْلَمُ مَا تُبْدُونَ وَمَا تَكْتُمُونَ

[24:54] Say, “Obey GOD, and obey the messenger.” If they refuse, then he is responsible for his obligations, and you are responsible for your obligations. If you obey him, you will be guided. The sole duty of the messenger is to deliver (the message).
قُلْ أَطِيعُوا اللَّهَ وَأَطِيعُوا الرَّسُولَ فَإِنْ تَوَلَّوْا فَإِنَّمَا عَلَيْهِ مَا حُمِّلَ وَعَلَيْكُمْ مَا حُمِّلْتُمْ وَإِنْ تُطِيعُوهُ تَهْتَدُوا وَمَا عَلَى الرَّسُولِ إِلَّا الْبَلَاغُ الْمُبِينُ

And what was the message that Muhammad was commissioned to deliver? In the following verse God informs us that the message that Muhammad was commissioned to deliver was only this scripture, the Quran alone, and not any other teachings.
[21:10] We have sent down to you a scripture containing your message. Do you not understand?
لَقَدْ أَنْزَلْنَا إِلَيْكُمْ كِتَابًا فِيهِ ذِكْرُكُمْ أَفَلَا تَعْقِلُونَ

God goes so far as to let us know that if Muhammad brought any other teachings, either deliberately or due to peer pressure from others, God would have stopped the revelations to him, ended his life on Earth, and doubled the retribution for him in the Hereafter.
[69:40] This (Quran) is the utterance of an honorable messenger. [69:41] Not the utterance of a poet; rarely do you believe. [69:42] Nor the utterance of a soothsayer; rarely do you take heed. [69:43] A revelation from the Lord of the universe. [69:44] Had he uttered any other teachings. [69:45] We would have punished him. [69:46] We would have stopped the revelations to him. [69:47] None of you could have helped him.
[17:73] They almost diverted you from the revelations we have given you. They wanted you to fabricate something else, in order to consider you a friend. [17:74] If it were not that we strengthened you, you almost leaned towards them just a little bit. [17:75] Had you done that, we would have doubled the retribution for you in this life, and after death, and you would have found no one to help you against us.
So based on this, does it make sense that Muhammad would mandated religious laws that contradict the Quran like we find in so many Hadith?