Muwatta Imam Malik Book of Prayer, Hadith 61
Yahya related to me from Malik from Muhammad ibn Amr ibn AIqama from Malik ibn Abdullah as-Sadi that Abu Hurayra said, "The one who raises his head and lowers it before the imam - his forelock is in the hand of a shaytan."
Malik said, concerning someone who forgot and raised his head before the imam in ruku or sujud, "The sunna of that is to return to bowing or prostrating and not to wait for the imam to come up. What he has done is a mistake, because the Messenger of Allah ﷺ said, 'The imam is appointed to be followed as a leader, so do not oppose him.' Abu Hurayra said, 'The one who raises his head and lowers it before the imam - his forelock is in the hand of a shaytan.' "
حَدَّثَنِي يَحْيَى، عَنْ مَالِكٍ، عَنْ مُحَمَّدِ بْنِ عَمْرِو بْنِ عَلْقَمَةَ، عَنْ مَلِيحِ بْنِ عَبْدِ اللَّهِ السَّعْدِيِّ، عَنْ أَبِي هُرَيْرَةَ، أَنَّهُ قَالَ الَّذِي يَرْفَعُ رَأْسَهُ وَيَخْفِضُهُ قَبْلَ الإِمَامِ فَإِنَّمَا نَاصِيَتُهُ بِيَدِ شَيْطَانٍ .