Is prayer valid behind an Imam who performs an act that the follower considers obligatory or a condition for prayer, but the Imam himself considers permissible or invalid?

Chapter on Imamate and Congregational Prayer

Al-Mughni

Book of Prayer

Book 3 · Issue 2 · Bab 10

Open in Qurani

Primary text

If the Imam performs an act concerning which there is disagreement, yet he believes it to be forbidden (*muharram*), and this act involves omitting what the follower believes is a condition or obligatory element of the prayer, then the Imam's prayer is invalid, and consequently, the prayer of the follower is also invalid, irrespective of the follower's differing belief. This is because abandoning an obligatory element invalidates the prayer, similar to established consensus.