All praise is due to Allah. One: If the Imam is confident that he has done the right thing and the muqtadis perform the prayer without raising an eyebrow to warn the worshipers and perform the five rak'at prayers, then his prayer is pure and there is nothing to be done about it. If at the end of the salutation his true condition is noticed (he has read five rak'ats by mistake) , then he will return the salutation with two prostrations to make a mistake. Two: If the muqtadis know for sure that the Imam has stood for an extra rak'at, then it is obligatory on him to warn the Imam. If the Imam does not hear it, then it is not permissible for him to follow the Imam. Rather, in this case, he will sit apart from the Imam and recite the last tashahhud and return the salutation. If the Muktadis know for sure that it is the fifth rak'ah ; Moreover, if he follows the Imam, his prayer will be canceled. And if he follows the Imam out of ignorance or by mistake, then his prayer will be pure. Sharh Muntahalairadat (1/223) says: “The Imam who has erred in prayer will be warned by two faithful persons. Then he must return to the Imam from the mistake ; Unless he is sure that his deeds are right. Then it is said- “If he stands for the fifth rak'ah then it is not permissible for the muqtadis to follow him. Because the muqtadis are sure that the imam is doing something wrong and that the rak'ah he has stood for is not part of the prayer. In this case, if the muqtadis follow the Imam ignorantly or by mistake, or if they deviate from the Imam, his prayer will be pure. It is necessary for a person who knows the real situation to be different from following the Imam . The person who has separated from the Imam will return the salutation separately after the Imam has stood for the extra rak'ah and will warn the Imam to return from the mistake after completing the last tashahhud. " The rak'ah is performed by the prayer , but what is the ruling on his prayer and what is the ruling on the prayer of those behind him ? And whoever comes late and joins the Imam, will he count this extra rak'ah ? ” He replied: If the Imam prays five rak'ats by mistake, then his prayer is pure, and the prayer of those who follow him by mistake or in ignorance is also pure. But the muqtada who is sure that it is an additional rak'ah, it is obligatory for him to sit down and return the salutation when the imam stands up for the fifth rak'ah . If he fears that the Imam has misread the recitation of Surah Fatiha in one rak'ah, then he is reciting the additional fifth rak'ah, then he will wait for the Imam without returning the salutation. That is, wait for the Imam to return the salutation. And the person who arrives late and joins the Imam in the second rak'ah or any subsequent rak'ah and prays at the end , this extra rak'ah will be counted in his case. He comes in the third rak'ah and joins , but he will add another rak'ah after returning the salaam of the extra rak'ah of the imam . The reason for this. On the other hand, this Imam is excused for performing extra rak'ahs because he has made a mistake. So his prayer will not be canceled. ” End of quote [Majmoo 'Fatawash Shaikh Ibn' Uthaymeen (14/19)] Allah knows best.