This excerpt is taken from the book of Fazilat-ul-Sheikh Abdul Salam Rustami From Denial of Hadith to Denial of Quran.
Sixteenth Doubt: The Hadith Regarding Presenting Hadith Before the Quran
The deniers have relied on this narration to reject hadith, which the scholars of Usul al-Fiqh have mentioned in their books, that the Messenger of Allah, peace be upon him, said:
إذا روي عني حديث فأعرضوه على كتاب الله فإن وافقه فاقبلوه وإن خالفه فردوه
"When a hadith is narrated to me, compare it with the Book of Allah; if it agrees with it, accept it, and if it contradicts it, reject it."
Reference: Tazkirat al-Muhtaj ila Ahadith al-Minhaj: 27/1, Hadith: 22
From this, it is established that when a hadith is in accordance with the Holy Quran, it is acceptable.
Answer:
Keep the following points in mind regarding this matter:
➊ The condition for deducing a ruling from a hadith is that the hadith must be authentic, whereas the mentioned hadith is not authentic. Imam Khattabi has narrated in Ma'alim al-Sunan about this hadith: "This hadith was fabricated by heretics." Similarly, it is written in the margin of Noor al-Anwar, and Ferozabadi, San'ani, and others have stated that no hadith in this chapter is authentic. Maulana Abdul Hay Lakhnawi has also narrated such details.
Reference: Zafar al-Amani, p. 462
Imam Suyuti has also refuted this narration.
Reference: Miftah al-Jannah fi al-Ihtijaj bi al-Sunnah, pp. 21, 10
➋ There are two meanings of conformity. One is that there is no difference in the content of the Quran and the hadith; in such a case, what need remains for the hadith?
The second case is that the hadith is not contrary to the Quran. In this case, our position is that a sound and accepted hadith can never be against the Quran. The apparent differences and contradictions between the Quran and hadith have been resolved by the scholars of deep knowledge; therefore, there is no contradiction between the Quran and authentic hadith.