Sahih al-Bukhari Book 10, Hadith 89
Allah's Messenger (ﷺ) said, "If the Imam leads the prayer correctly then he and you will receive the rewards
but if he makes a mistake (in the prayer) then you will receive the reward for the prayer and the sin
will be his."
The Prophet (ﷺ) said, "Listen and obey (your chief) even if an Ethiopian whose head is like a raisin were made your chief."
I went to 'Uthman bin Affan while he was besieged, and said to him, "You are the chief of all Muslims in general and you see what has befallen you. We are led in the Salat (prayer) by a leader of Al-Fitan (trials and afflictions etc.) and we are afraid of being sinful in following him." 'Uthman said. "As-Salat (the prayers) is the best of all deeds so when the people do good deeds do the same with them and when they do bad deeds, avoid those bad deeds." Az-Zuhri said, "In our opinion one should not offer Salat behind an effeminate person unless there is no alternative."