Ref. No. 937/41-75
In the name of Allah the most Gracious the most Merciful
The answer to your question is as follows:
Niyyat refers to intention of one's heart. The intention does not need to be uttered verbally. If a person utters something by mistake that goes against what he intended, then the intention is counted not his wordings. Therefore, if you were determined (by heart) to pray isha namaz and uttered ‘Magrib’ instead of ‘Isha’, mistakenly due to slip of your tongue, then your namaz would be regarded valid. You needed not to do Tahrima again. Nevertheless, if you uttered extra ‘Allahu Akbar’ after Tahrima it didn’t invalidate your namaz yet. So don’t worry regarding the validity of your namaz in this case.
And Allah knows best
Darul Ifta
Darul Uloom waqf Deoband