Mishkat al-Masabih 761
وَعَنْ أَبِي هُرَيْرَةَ قَالَ: بَيْنَمَا رَجُلٌ يُصَلِّي مسبلا إِزَارِهِ قَالَ لَهُ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «اذْهَبْ فَتَوَضَّأ» فَذهب وَتَوَضَّأ ثُمَّ جَاءَ فَقَالَ رَجُلٌ: يَا رَسُولَ اللَّهِ مَا لَكَ أَمَرْتَهُ أَنْ يَتَوَضَّأَ؟ قَالَ: «إِنَّهُ كَانَ يُصَلِّي وَهُوَ مُسْبِلٌ إِزَارَهُ وَإِنَّ اللَّهَ تَعَالَى لَا يَقْبَلُ صَلَاةَ رَجُلٍ مُسْبِلٍ إِزَارَهُ» . رَوَاهُ أَبُو دَاوُد
And from Abu Hurayrah, who said: While a man was praying with his lower garment hanging down, the Messenger of Allah ﷺ said to him: "Go and perform wudu." He went and performed wudu, then came. A man said: "O Messenger of Allah, why did you command him to perform wudu?" He said: "He was praying with his lower garment hanging down, and Allah the Exalted does not accept the prayer of a man whose lower garment hangs down." Reported by Abu Dawud.