Making up for what was missed from the funeral prayer immediately after joining the imaam

Question
We see many people who have joined the funeral prayer late, missing some parts of it. They make up what they missed at the beginning of the prayer by themselves rather than at the end. Is this valid or is their prayer invalid?
Answer

This is invalid. The latecomer should join considering the first takbeer, saying Allaahu Akbar!, Allaah is Greatest!, to be considered in his first unit of prayer. Hence, he should join the prayer saying takbeer and then reading soorah Al-Faatihah. Then on his second takbeer with the imaam, he should recite the salutations upon the Prophet ﷺ. Then after the third takbeer, he should make a supplication for the deceased. Then after the fourth takbeer, he should end the prayer in the normal manner of ending prayers. This is the order. However, he may say, ‘The third takbeer with regards to the imaam is a long supplication and I have joined the imaam at that stage. After I have finished reading soorah Al-Faatihah, I will have time left over to catch up.’ This is what many people do, because the third takbeer is equivalent in terms of time to two takbeers. Therefore, it gives enough time to complete two units of takbeers. Thus, he says, ‘During the third takbeer, the supplication is very long, so I will recite soorah Al-Faatihah and then then I will make a takbeer and recite a salutation upon the Prophet ﷺ and I can do the takbeer and make supplication while the imaam has not made takbeer yet.’ This is done by a person who fears that the coffin will be removed and will not be able to make supplication for the deceased, which is the main purpose of the funeral prayer. In any case, what we have mentioned is that most scholars maintain that a latecomer to prayer will start his first part when he joins. Therefore, he should recite soorah Al-Faatihah, then after the next takbeer, he should recite greetings upon the Prophet ﷺ. Then after the third takbeer, he should pray for the deceased, and then after the fourth, he should end the prayer. According to the Hambalis and Hanafis the latecomer will join the imaam at the unit he is at. Hence, if he joins at the third takbeer and the imaam is making supplication for the deceased, he should do the same. Then he will make up for what was missed after the imaam has finished his prayer. Once he has, the latecomer will make takbeer and start from the beginning with soorah Al-Faatihah, then the second takbeer and recite the greetings in it, and then end the prayer in the normal manner of ending prayers. In any case, the preferred opinion is that the latecomer should consider the point he joins the prayer to be his first takbeer and the thus recites soorah Al-Faatihah, then wait for the second takbeer and send greetings to the Prophet ﷺ, then wait for the third takbeer to make a supplication for the deceased. If he fears that the coffin will be removed straight after the imaam finishes, then he would quickly make supplication in brief and end the prayer in the normal manner of ending prayers.