The Messenger of Allah ﷺ said, "Does the one who raises his head before the imam not fear that Allah will turn his head into the head of a donkey?"
حدثنا حميد بن مسعدة وسويد بن سعيد قالا حدثنا حماد بن زيد حدثنا محمد بن زياد
قال رسول الله ﷺ ألا يخشى الذي يرفع رأسه قبل الإمام أن يحول الله رأسه رأس حمار
[Sahih]. Narrated by Muslim, in the Book of Prayer, chapter on the prohibition of preceding the imam in bowing or prostration or the like, hadith no. 427, from the hadith of Hammad bin Zayd, with this same wording.