In line with the Qur'anQur'an 23:2 ↗ٱلَّذِينَ هُمۡ فِي صَلَاتِهِمۡ خَٰشِعُونَ
Those who are humble in their prayers.
The verse praises believers who are humbly attentive in prayer, the attention lost when praying while needing to relieve oneself; agreement is partial.
In line with the Qur'anQur'an 4:43 ↗يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُواْ لَا تَقۡرَبُواْ ٱلصَّلَوٰةَ وَأَنتُمۡ سُكَٰرَىٰ حَتَّىٰ تَعۡلَمُواْ مَا تَقُولُونَ وَلَا جُنُبًا إِلَّا عَابِرِي سَبِيلٍ حَتَّىٰ تَغۡتَسِلُواْۚ وَإِن كُنتُم مَّرۡضَىٰٓ أَوۡ عَلَىٰ سَفَرٍ أَوۡ جَآءَ أَحَدٞ مِّنكُم مِّنَ ٱلۡغَآئِطِ أَوۡ لَٰمَسۡتُمُ ٱلنِّسَآءَ فَلَمۡ تَجِدُواْ مَآءٗ فَتَيَمَّمُواْ صَعِيدٗا طَيِّبٗا فَٱمۡسَحُواْ بِوُجُوهِكُمۡ وَأَيۡدِيكُمۡۗ إِنَّ ٱللَّهَ كَانَ عَفُوًّا غَفُورًا
O you who believe! Do not approach the prayer while you are drunk, so that you know what you say; nor after sexual orgasm—unless you are travelling—until you have bathed. If you are sick, or traveling, or one of you comes from the toilet, or you have had intercourse with women, and cannot find water, find clean sand and wipe your faces and your hands with it. God is Pardoning and Forgiving.
The verse forbids approaching prayer until one knows what one says, close to the ban on praying while distracted by bodily need.