In Salah, Except for the following rituals and utterances of the Salah, everything else is optional:
Discussion 59404 • Reply 59446
Since utterances in Qada are not obligatory, but are optional therefore, there is no restriction if one wants to offer this prayer or opts to offer any other prayer while sitting in Tashahud. The qadah of the prayer is reserved for supplications, and a person can say whatever supplication he wants to. The guidance provided by the practice of the Prophet (sws) in this regard related to this particular supplication is as follows:
Abdullah ibn Masud (rta) says that when we would pray with the Prophet (sws), we would say: “Peace be to God from His servants and peace be to such and such persons.” When the Prophet (sws) heard this, he said:“Don’t say: ‘Peace be to God,’ for God Himself is entirely peace. Say this instead: التَّحِيَّاتُ لِلَّهِ وَالصَّلَوَاتُ وَالطَّيِّبَاتُ السَّلَامُ عَلَيْكَ أَيُّهَا النَّبِيُّ وَرَحْمَةُ اللَّهِ وَبَرَكَاتُهُ السَّلَامُ عَلَيْنَا وَعَلَى عِبَادِ اللَّهِ الصَّالِحِينَ (all salutations, supplications and good deeds are for God; O Messenger of God! Peace be to you, and blessings and mercy. Peace be to us also and to all pious people too). If you say these words, your supplication will reach every person who is in the sky or is found somewhere between the sky and the earth. [He further said:] أَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللَّهُ وَأَشْهَدُ أَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ (I bear witness that there is no god except Allah and I bear witness that Muhammad (sws) is His servant and Messenger). After this, a person can say any supplication he wants to for himself.” (Source: https://sunnah.com/bukhari:835)
With slight variations, the above supplication is also reported by Umar (rta), Aishah (rta), Abdullah ibn Umar (rta), Abdullah ibn Abbas (rta) and Abu Musa al-Ashari (rta) (Source: https://sunnah.com/bukhari:831, https://sunnah.com/abudawud:971 etc.). It is evident from the narratives that after this, the Prophet (sws) would diligently teach this supplication to his Companions (rta) (Source: https://sunnah.com/muslim:403a, https://sunnah.com/muslim:403b)