Assalaamu alaykum wa rahmatullaahi wa barakaatuhu. Shaykhs, Yesterday, in the third unit of prayer, I forgot to recite Surat Al-Faatihah and recited Surat Al-Ikhlaas and then bowed, but I then realized this and then said Takbeer (saying: Allahu Akbar [Allah is Most Great]) after raising my head from bowing or after saying: "Allah hears the one who praises him" (and maybe more than that) and then recited Surat Al-Faatihah and then continued with the prayer and prostrated before the Tasleem (ending the prayer with the Salam greeting). Was my prayer valid? Is what I did right? May Allah reward you, Shaykhs.
All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ʻalayhi wa sallam, is His slave and Messenger.
One of the conditions for the validity of the prayer is observing the reported sequence of its pillars. The Hanbali scholar Ar-Ruhaybani wrote about the pillars of the prayer:
"Fourteen: observing the order of the pillars of the prayer as mentioned, because the Prophet, sallallahu ʻalayhi wa sallam, used to perform it in that order, and he taught the Companion who performed the prayer improperly to observe the pillars of the prayer in that order, using the word 'then' (which denotes sequence). Also, because it is an act of worship that is invalidated by breaking ablution, of which sequence is one of its pillars as well. If the praying person deliberately prostrates before bowing, his prayer is invalid because he neglected the correct sequence. If he forgetfully prostrates before bowing, it is obligatory on him to stand up again to bow and then prostrate in the correct order.
The Maaliki scholar Al-Mawwaaq wrote, 'One of the obligations of prayer is observing the correct sequence of its acts. Al-Qabbaab said, ‘If someone reversed his prayer and starts with sitting before standing, or with prostrating before bowing or the like, his prayer is invalid according to the consensus of the scholars.’'" [At-Taaj wa Al-Ikleel]
Based on the above, your prayer is invalid and you have to make up for it if you did not repeat the bowing after reciting the Faatihah, because you did not observe the correct sequence of prayer by bowing before reciting the Faatihah, and you did not repeat the bowing after reciting it. Performing Sujood As-Sahw (prostration of forgetfulness) is not sufficient in terms of correcting this mistake.
Allah knows best.
You can search for fatwa through many choices