Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ahmad:10069ʿAbd al-Raḥman > Ḥammād > Muḥammad > Abū Hurayrah > Abū al-Qāsim ﷺ > Amā Yakhshá Aḥadukum Idhā Rafaʿ Raʾsah And al-Imām Sājid

[Machine] I heard Abu Al-Qasim ﷺ saying, "Doesn't anyone fear that when he raises his head and the Imam is in prostration, Allah may turn his head into the head of a donkey?"  

أحمد:١٠٠٦٩حَدَّثَنَا عَبْدُ الرَّحْمَنِ حَدَّثَنَا حَمَّادٌ عَنْ مُحَمَّدٍ قَالَ سَمِعْتُ أَبَا هُرَيْرَةَ يَقُولُ

سَمِعْتُ أَبَا الْقَاسِمِ ﷺ يَقُولُ أَمَا يَخْشَى أَحَدُكُمْ إِذَا رَفَعَ رَأْسَهُ وَالْإِمَامُ سَاجِدٌ أَنْ يَجْعَلَ اللهُ رَأْسَهُ رَأْسَ حِمَارٍ  


See similar narrations below:

Collected by Suyūṭī
suyuti:4247a

Abu Hurairah reported the Messenger of Allah ﷺ as saying; Does he who raises his head while the Imam is prostrating not fear that Allah may change his head into a donkey’s or his face into a donkey’s face. (Using translation from Abū Dāʾūd 623)   

السيوطي:٤٢٤٧a

"أما يخشَى أحدُكم إذا رفعَ رأسَهُ قبلَ الإِمام أن يجعلَ اللهُ رأسَهُ رأسَ حمارٍ، أوْ يجعلَ اللهُ صُورته صورةَ حمارٍ".  

[حم] أحمد [ش] ابن أبى شيبة [خ] البخاري [م] مسلم [د] أبو داود [ت] الترمذي [ن] النسائي [هـ] ابن ماجة عن أبي هريرة (وفي رواية لابن حبان: أن يحول الله رأسه رأس كلبٍ)