Intentionally reciting the third testimony during the tashahhud makes the prayer void, since it is not amongst the divinely-authorized words that are allowed to be recited in the prayer. If he was unaware of the said ruling, his previous prayers are valid; also, they are valid if he recited it believing it to be recommended.
It is one of the important sources that researchers refer to in order to learn about the biography of the Prophet and the Imams (peace be upon them all).