From Sahih Muslim (Hadith 1835):
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
Reference: Muslim 1835