Messenger of Allah ﷺ said, "If anyone of you feels drowsy while praying he should go to bed (sleep) till his slumber is over because in praying while drowsy one does not know whether one is asking for forgiveness or for a bad thing for oneself."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِذَا نَعَسَ أَحَدُكُمْ وَهُوَ يُصَلِّي فَلْيَرْقُدْ حَتَّى يَذْهَبَ عَنْهُ النَّوْمُ فَإِنَّ أَحَدَكُمْ إِذَا صَلَّى وَهُوَ نَاعِسٌ لاَ يَدْرِي لَعَلَّهُ يَسْتَغْفِرُ فَيَسُبَّ نَفْسَهُ