Is it valid to Pray `Isha’ at Maghrib’s Time?
Question

The Adhan of Maghrib was given, and I thought it was `Isha’, so I prayed Maghrib with four Rak`ahs, intending it as `Isha’. When I sat with my family and the Adhan was given for `Isha’, I wondered about that, and they told me that the Adhan for `Isha’ had only just been given. Should I repeat Maghrib prayer or not?
Praise be to Allah.Shaykh `Abd Al-`Aziz ibn Baz (may Allah have mercy on him) said:
If she did not pray Maghrib, and she prayed `Isha’ before Maghrib, thinking that the Adhan was for `Isha’, and she forgot to pray Maghrib, then she should repeat it; she should pray Maghrib and then repeat `Isha’, because she prayed `Isha’ at the wrong time, at the time of Maghrib.
But if she had prayed Maghrib when the sun set, then her Maghrib prayer was valid, but she had to repeat `Isha’ because she prayed it before its time.
Prayer offered at the wrong time is not valid, but if she had not prayed Maghrib, she must make up Maghrib then pray `Isha’. (End quote from Fatawa Nur `ala Ad-Darb, 2/728)
For more details, please see the following answers:
What Are the Times of the Five Daily Prayers?
Praying Maghrib behind one who is praying ‘Isha’
Can You Pray Maghrib and ‘Isha Together Due to Short Nights?
Is Combining Maghrib and Isha when Raining Allowed?
Joining Maghrib and ‘Isha’ because of the curfew
And Allah knows best.