Answered by Shaykh Faraz Rabbani
Zayd is traveling and the time for Isha comes in. Zayd goes in the Masjid ,sees a Jamaa’ah, and joins it. After the Salah is finished ,Zayd realises that the Jama’ah were non-Hanafis praying delayed Maghrib(takheer). after that they make Isha. What is the Status of this 3 Rakah prayer Zayd made with the Jama’ah? (Zayd had already prayed Maghrib on its time). Is it considered a Nafl? Does Zayd still have to make his Isha?
It is a condition for the validity of praying behind an imam that the imam intend the same or more incumbent prayer than oneself. As such, you cannot pray an obligatory prayer behind someone praying a supererogatory (nafl) prayer), or pray your current Zuhr behind someone praying Asr or a makeup Zuhr from the past. [As mentioned by Ibn Abidin in his Hashiya]
Therefore, in the case mentioned, Zayd would have to add another rakat to make it a 4 rakat nafl prayer, and then pray Isha again.
Wassalam,
Faraz