What is the ruling for a person praying behind an Imam deemed unsuitable for leading the prayer?
Chapter on Imamate and Congregational Prayer
Al-Mughni
Book of Prayer
Primary text
If the obligatory prayer is established while a person is in the mosque and the Imam is one whose leadership is deemed invalid, the follower may pray behind him. If the follower intends to pray alone but matches the Imam in bowing, prostrating, standing, and sitting, the prayer is valid because the follower has fulfilled the acts and conditions of prayer perfectly. This is comparable to a situation where the follower does not intend to mimic the Imam. However, Ahmad narrated that repetition (re-doing the prayer) is required in this situation. If the follower prays along while intending the prayer to be for himself (as an individual prayer), and then performs the Takbir, bowing, and prostration for himself without regard to coinciding with the Imam, Ahmad stated that re-doing the prayer is necessary. However, the reasoning for requiring re-doing based on the intention of invalidation suggests that if the intention is to count the prayer, it is valid, which is the sounder view.
Supporting text
A view narrated from Ahmad suggests the follower should pray behind the unsuitable Imam, but must repeat the prayer afterwards, especially if leaving the mosque after the call to prayer would cause public disapproval (*shan'ah*). Another option given by Ahmad is for the follower to intend his prayer as an individual one, matching the Imam's movements only coincidentally.