The Messenger of Allah ﷺ said to me, "My son, beware of turning your gaze during prayer, for turning your gaze during prayer is ruinous. If you must do so, then let it be in voluntary prayer, not in the obligatory one."
حدثنا أبو حاتم مسلم بن حاتم البصري حدثنا محمد بن عبد الله الأنصاري عن أبيه عن علي بن زيد عن سعيد بن المسيب قال قال
لي رسول الله ﷺ يا بني إياك والالتفات في الصلاة فإن الالتفات في الصلاة هلكة فإن كان لا بد ففي التطوع لا في الفريضة
No references are available.
[Its chain of transmission is daif]. Tabarani related it in Al-Saghir, 22/32, 33, from the hadith of Muslim bin Hatim, in full, and said, "Muslim Ansari related it alone, and he was trustworthy." It is also in Sharh al-Sunnah, 3/253, 254, hadith 735, by way of Tirmidhi with the same wording.Ali bin Zayd bin Jadan is daif.