The Prophet ﷺ said, "When one of you grows drowsy while praying, he should lie down and sleep until the drowsiness leaves him, for if he prays while drowsy, he may intend to seek forgiveness yet end up cursing himself."
حدثنا يحيى حدثنا هشام ووكيع عن هشام المعنى قال أخبرني أبي
عن النبي ﷺ قال إذا نعس أحدكم وهو يصلي فليرقد حتى يذهب عنه النوم فإنه إذا صلى وهو ينعس لعله يذهب يستغفر فيسب نفسه