Al-Khaṭīb recorded it in al-Tārīkh (14/98).
I say: This is weak and unsound. Layth—namely, Ibn Abī Sulaym—became confused in his narrations. Dhū al-Nūn was declared weak by al-Dāraqutnī and al-Jūzajānī, and I have not identified Abū ʿUmar al-Ramlī. Aḥmad ibn Ṣulayḥ al-Fayyūmī corroborated him, saying: Abū al-Fayḍ Dhū al-Nūn narrated it to us, in an abbreviated form, omitting the mention of the scholar’s slip and the severity of the just ruler. Abū Nuʿaym recorded it (10/4), then also recorded it through Muḥammad ibn ʿUqbah al-Makkī, from Fuḍayl ibn ʿIyāḍ, with similar wording.
A point of benefit: al-Bayhaqī narrated from al-Shāfiʿī—may Allah have mercy on him—that he said: “Those of dignified standing whose slips are overlooked are those who are not known for wrongdoing, yet one of them commits a slip.”
639 — “He would not observe qunūt except when he supplicated for a people or supplicated against a people.”
Ibn Khuzaymah recorded it in his Ṣaḥīḥ, no. 620: Muḥammad ibn Muḥammad ibn Marzūq al-Bāhilī informed us; Muḥammad ibn ʿAbd Allāh al-Anṣārī narrated to us; Saʿīd ibn Abī ʿArūbah narrated to us, from Qatādah, from Anas, traced back to the Prophet.
I say: This is a good chain of transmission and meets Muslim’s criteria. There is some criticism of Ibn Marzūq, but it does not lower his hadith