(Imām Bukhārī narrates): Al-Fadl ibn Sahl narrated to us, he said: Al-Hasan ibn Mūsā al-Ashyab narrated to us, he said: 'Abdur-Rahmān ibn 'Abdullāh ibn Dīnār narrated to us, from Zaid ibn Aslam, from 'Atā' ibn Yasār, from Abū Hurairah, may Allāh be pleased with him, that the Messenger of Allāh ﷺ said:
(The imāms) will lead you in prayer; if they lead it correctly, then its reward is for you; and if they make a mistake, then its reward is for you, and its punishment is upon them.
Reference: Sahih Al Bukhari 694