The Messenger of Allah ﷺ said, "When one of you grows drowsy during his prayer, let him lie down and sleep until the drowsiness leaves him. For when one of you prays while drowsy, he does not know, perhaps he sets out to ask forgiveness and instead curses himself."
و حدثني عن مالك عن هشام بن عروة عن أبيه
أن رسول الله ﷺ قال إذا نعس أحدكم في صلاته فليرقد حتى يذهب عنه النوم فإن أحدكم إذا صلى وهو ناعس لا يدري لعله يذهب يستغفر فيسب نفسه