The command to one who becomes sleepy while praying, or who starts to falter in his recitation of the Qur’an or statements of remembrance, to lie down or sit down until that goes away Sahih Muslim 786
Translation
'A'isha reported Allah's Apostle (ﷺ) as saying
When anyone amongst you dozes in prayer, he should sleep, till sleep is gone, for when one of you prays while dozing he does not know whether he may be asking pardon or vilifying himself.