Ayesha reported,

The Messenger of Allah ﷺ said, "When one of you grows drowsy while praying, let him lie down to sleep until the drowsiness leaves him, for when one of you prays while drowsy, he does not realize that perhaps he intends to seek forgiveness but ends up cursing himself instead."

Azami 2768

Sahih

عن عائشة

أن رسول الله ﷺ قال: إذا نعس أحدكم وهو يصلي فليرقد حتى يذهب عنه النوم، فإن أحدكم إذا صلى وهو ناعس لا يدري لعله يذهب يستغفر فيسب نفسه.

الأعظمي 2768صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Minor actions do not invalidate the prayer
Section
Whoever becomes drowsy during prayer should sleep until the sleepiness leaves him
Numbering
Jami al-Kamil 2768 (2nd edition)
Azami 2768