The Messenger of Allah ﷺ said: Does the man who lifts his head before the Imam not fear that Allah may change his face into that of an ass? (Using translation from Muslim 427b)
قَالَ رَسُولُ اللهِ ﷺ مَا يُؤْمَنُ الَّذِي يَرْفَعُ رَأْسَهُ فِي صَلَاتِهِ قَبْلَ الْإِمَامِ أَنْ يُحَوِّلَ اللهُ صُورَتَهُ صُورَةَ حِمَارٍ