The Messenger of Allah ﷺ said, "They lead you in prayer. If they get it right, both you and they are rewarded, but if they err, you still receive your reward and the burden falls on them."
أن رسول الله ﷺ قال: يصلون لكم فإن أصابوا فلكم، وإن أخطؤوا فلكم وعليهم.
Bukhari narrated it in the Book of Adhan (694) from Fadl bin Sahl, who said, Hasan bin Musa Ashyab told us, who said, Abdul-Rahman bin Abdullah bin Dinar told us, from Zayd bin Aslam, from Ata bin Yasar, from Abu Hurairah, who mentioned it.