Answer:
(Fatwa: 249/222=B/1429)
In following an imam, it is necessary that the muqtadi and imam have same intention, so following imam praying Isha with the intention of Maghrib is not right, the salah will be invalid.
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband
