The Messenger of Allah ﷺ said, "People must stop raising their eyes toward the sky during supplication in prayer, or their sight will be snatched away."
أخبرنا أحمد بن عمرو بن السرح عن ابن وهب قال أخبرني الليث عن جعفر بن ربيعة عن الأعرج
أن رسول الله ﷺ قال لينتهين أقوام عن رفع أبصارهم عند الدعاء في الصلاة إلى السماء أو لتخطفن أبصارهم
The prohibition against raising one's gaze to the sky during prayer, no. 429.Sourced from: Muslim reported it, in the Prayer, chapter on the prohibition against [raising the gaze to the sky during prayer], from Ahmad bin Amr bin Sarh, by this route, and it is also found in al-Kubra, no. 1199.