Answer
(Fatwa: 373/341=B/1430)
Standing in third rak?ah is fardh and sitting in qa?dah is wajib. When the imam was alerted, he returned to wajib leaving the fardh, it was wrong. As per the rule, it can invalidate salah, but the scholars of Fqih have regarded salah valid. But, the imam should be convinced that if he forgets first qa?dah and got up for third rak?ah, he should not return to qa?dah though he is alerted by those behind him. The salah will be valid after performing sajdah sahv (remedial prostration). The imam should be admonished if he told a lie.
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband