It is narrated from Tawus (may Allah have mercy on him) that the Messenger of Allah (peace and blessings be upon him) said: "Let people not hold me to anything, for I make lawful for them only what Allah has made lawful for them, and I make unlawful for them only what Allah has made unlawful."
Imam al-Shafi'i (may Allah have mercy on him) said: This is munqati' (its chain is broken). And even if it were established, it is clear from it that it is as I have described, if Allah wills: he (peace and blessings be upon him) said, "Let people not hold me to anything," and he did not say, "Let them not hold to what comes from me"; rather he commanded that what comes from him be held to, and Allah, exalted be His praise, commanded that.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النكاح / 13440