Answered by Shaykh Ilyas Patel
A person praying salat al-witr forgets to stand up after first sitting until he has said both salams. He stands up for the third rakat immediately after the mistaken salams and then does sajda sahw. Valid or not?
It is mentioned in Nur al Idha as follows:
“And one will make prostration of forgetfulness (sajda sahw) even if the (two) salams are made intentionally to complete (the prayer) as long as one has not turned away from the qibla or has spoken.”
(Shuranbulali, Nur al Idha,pg110)
And Allah knows best.
Ilyas