his grandfather, who said: “Al-Walīd ibn al-Walīd would become frightened in his sleep, and he mentioned this to the Prophet, peace and blessings be upon him, who then related the hadith.” That is what he stated.
However, the hadith in Abū Dāwūd’s Book of Medicine (3893), through the route mentioned above, reads: “The Messenger of Allah, peace and blessings be upon him, would teach them certain words to say when frightened...” He then mentioned them. Al-Walīd ibn al-Walīd is not mentioned in it. Al-Tirmidhī (3519) likewise transmitted it and graded it good; as did al-Nasāʾī in ʿAmal al-Yawm wa-l-Laylah (no. 765), al-Ḥākim (1/548), al-Bayhaqī (pp. 185–186), and in his al-Ādāb (993), Ibn al-Sunnī (744), Aḥmad (2/181), and Ibn Abī Shaybah (10/364)—all of them through Ibn Isḥāq, with the chain given in the “from... from...” form.
Al-Bukhārī did, however, cite it in suspended form in Afʿāl al-ʿIbād (p. 88, Indian edition), on the authority of his teacher Aḥmad ibn Khālid—namely Abū Saʿīd al-Kindī—who said: “Muḥammad ibn Isḥāq narrated to us,” with the same chain. Its wording is: “Al-Walīd ibn al-Walīd was a man who would become frightened in his sleep...” and so on. This is also the version transmitted by al-Nasāʾī and Ibn ʿAbd al-Barr. Perhaps, then, attributing it to Abū Dāwūd was a slip of the pen. Allah knows best.
I then found a mursal corroborating report for the hadith under discussion, narrated by Muṣʿab ibn Shaybah from Yaḥyā ibn Jaʿdah, who said: “Khālid ibn al-Walīd would become frightened at night, to the point that he would come out carrying his sword...” The hadith is similar, with the addition at its end: “Khālid recited them, and that left him.”