Answered by: Aalimah Sabrina al-Faarsiyyah
Assalamu Alaikum Wa Rahmatullah
Salam, I was wondering if you could tell me what the correct thing to do is in the following situation:
I was praying salaah in a jamaah that was combining I thought they were praying isha so I made the nafl intention for it, but they were praying maghrib. Do I need to redo my maghrib salah and nafl?
بسم الله الرحمن الرحيم
In the name of Allah, the Most Gracious, the Most Merciful.
Assalamualaikum Wa Rahmatullahi Wa Barakaatuh
If at the time you were performing your Salah; it was the time for Maghrib Salah, then although you made the intention of Nafl Salah, your Maghrib Salah was fulfilled behind the Imam. This is because the Imam had made the intention of performing Maghrib and leading everyone behind him in that.[]
It is better for a Muqatadi (follower) that whenever he intends on joining a congregation and is unsure regarding which salah is being performed, then he should enter the salah with the intention of following the imam and performing the salah that the imam is performing.[]
Only Allāh Ta’ālā knows best
Written by Aalimah Sabrina al-Faarsiyyah
Checked and approved by Mufti Mohammed Tosir Miah
Dārul Iftā Birmingham
 Al-Fatawa al-Hindiyyah, 1/123, Al-Maktabah al-Faisal
رَجُلٌ افْتَتَحَ الْمَكْتُوبَةَ فَظَنَّ أَنَّهَا تَطَوُّعٌ فَصَلَّى عَلَى نِيَّةِ التَّطَوُّعِ حَتَّى فَرَغَ فَالصَّلَاةُ هِيَ الْمَكْتُوبَةُ وَلَوْ كَانَ الْأَمْرُ بِالْعَكْسِ فَالْجَوَابُ بِالْعَكْسِ. هَكَذَا فِي فَتَاوَى قَاضِي خَانْ.
 Al-Fatawa al-Hindiyyah, 1/124, Al-Maktabah al-Faisal
إذَا اقْتَدَى بِالْإِمَامِ يَنْوِي صَلَاةَ الْإِمَامِ وَلَا يَعْلَمُ أَنَّ الْإِمَامَ فِي أَيَّةِ صَلَاةٍ فِي الظُّهْرِ أَوْ فِي الْجُمُعَةِ أَجْزَأَهُ أَيَّتُهَا كَانَتْ…وَإِذَا أَرَادَ الْمُقْتَدِي تَيْسِيرَ الْأَمْرِ عَلَى نَفْسِهِ يَنْبَغِي أَنْ يَنْوِيَ صَلَاةَ الْإِمَامِ وَالِاقْتِدَاءَ بِهِ أَوْ يَنْوِيَ أَنْ يُصَلِّيَ مَعَ الْإِمَامِ مَا يُصَلِّي الْإِمَامُ. كَذَا فِي الْمُحِيطِ.