It is narrated from Sayyiduna Abdullah bin Amr (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) said: "There are three whose prayer Allah Almighty does not accept: an imam whom the people dislike; a man who prays after the time of the prayer has ended; and a man who has enslaved a free person."
Imam al-Shafi'i (may Allah have mercy on him) says: The prayer of one who leads a people in prayer while they dislike him is not accepted, nor that of a woman whose husband is displeased with her, nor that of a runaway slave until he returns. And he said: I do not recall a route for it on the basis of which the people of knowledge would establish this hadith.
This hadith with this meaning is narrated only through two weak chains, one of them mursal (with a missing Companion link) and the other connected.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5339