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.
You did the right thing and you are not required to repeat the prayer, and that is because whoever leaves a pillar and remembers it after starting the recitation of the next rak’ah, then he ignores that rak’ah in which he forgot the pillar and thus the second rak’ah becomes his first rak'ah and the prayer is completed based on this.
Al-Athram said in Matalib Uli al-Nuha: I asked Abu 'Abdullah about a man who prayed one rak’ah and then got up for another, and then he remembered that he prostrated only once in the first rak'ah; he said: If that was the first thing that happened when he got up before starting doing anything else for the second rak'ah, then he goes back and prostrates and counts on it, but if he had done anything in the second Rak'ah, then he makes this his first rak'ah, and cancels what preceded it.”
And because you left the prostration in the first rak’ah, the second rak’ah in which you remembered it becomes the first, and the third rak’ah becomes the second.
Allah knows best.