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.
In your question, you suggest that the person praying made a mistake or was forgetful. He was neither. When the praying person misses some of the prayer with the Imam, he should comply with whatever the Imam does regardless of whether that fits into the normal order of his prayer or not.
As a result, he is not required to make any prostration of forgetfulness because of his following the Imam. The Prophet said: “The Imam is there to lead the prayer, so you should follow him …” Even if this person does this while following an Imam, he is not supposed to prostrate for forgetfulness because the Imam bears that instead of him as long as he is praying with the Imam and not alone.
Allah knows best.