I believe he reported it from the Prophet ﷺ who said, "People must stop raising their eyes toward the sky during prayer, or their sight will be snatched away."
حدثنا أبو النضر حدثنا المبارك عن الحسن
وأراه عن النبي ﷺ قال لينتهين أقوام يرفعون أبصارهم إلى السماء في الصلاة أو لتخطفن أبصارهم
Its isnad is sahih. Bukhari related it in the Book of Prayer from Hajjaj bin Minhal with the wording, "Does the one who raises his head before the imam not fear...?" Muslim related it in the Book of Prayer from Khalaf bin Hisham, Abu Rabi Zahrani, and Qutayba bin Saeed, and also from Amr Naqid and Zuhayr bin Harb. Abu Dawud related it in the Book of Prayer from Hafs bin Amr. Tirmidhi related it in the Book of Prayer from Qutayba. Nasai related it in the Book of Prayer from Qutayba. Ibn Majah related it in the Book of Prayer from Humayd bin Masada and Suwayd bin Saeed.