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 is His slave and Messenger.
If the worshiper repeats the Tashahhud because of forgetting some of it, or doubting about it, or that he repeats it deliberately, then his prayer is valid and he is not required to prostate for forgetfulness.
Al-Majmoo’ authored by an-Nawawi reads:
“Also, if he repeats the last Tashahhud and sends blessing and peace on the Prophet deliberately, his prayer does not become invalidated.” [End of quote]
Besides, the footnote of ar-Ramli reads while commenting on the statement of Zakariyyah al-Ansari in Asna al-Mataalib:
“Yes, if he recites a Surah before al-Faatihah, then he does not prostrate for forgetfulness; also, if he repeats the Tashahhud, out of forgetfulness or because of doubting about it, and then he repeated it, he does not prostrate for forgetfulness, as stated by al-Qaadhi al-Hussein.” [End of quote]
Allah knows best.