Praise be to Allah.
If the matter is as described, there is nothing wrong with that, but it would have been better if the soorah that was recited in the second rak‘ah was one that came after the soorah that was recited in the first rak‘ah, in accordance with the sequence of soorahs in the Qur’an.
And Allah is the source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and companions. End quote.
Standing Committee for Academic Research and Issuing Fatwas
Shaykh ‘Abd al-‘Azeez ibn ‘Abdullah ibn Baaz, Shaykh ‘Abd ar-Razzaaq’Afeefi, Shaykh ‘Abdullah ibn Ghadyaan, Shaykh ‘Abdullah ibn Qa ‘ood
Fataawa al-Lajnah ad-Daa’imah, 4/16
For more information, please see the answer to question no. 7198
And Allah knows best.