Sajda-e-Sahw

Sajda-e-sahw

Q: Can you please explain uptil when sajda-e-sahw can be done for unintentionally missing out a wajib in the prayer? If a person unintentionally leaves out a wajib, and they have done salaam, can they still do sajda-e-sahw? Also, if a person does not do sajda-e-sahw, and the prayer time has ended, will they have to redo the prayer? I have heard that the prayer will have to be redone for leaving out a sajda-e-sahw as long as its still the prayer time, but after the prayer time has passed, it is not mandatory to redo the prayer, but recommended to. Please if you can explain.

Forgetting to recite a Surah in the third rakaat of Sunnat Salaah

Q: I performed the four sunnah of Asr salaah however in the 3rd rakaat I forgot to read a Surah after Surah Fatiha only realised this in ruku. I intended to make sajda sahwa but after the 4th rakaat I read the tashahud, durood and dua and made both salaams. Whilst making the second salaam I remembered the sajda-e-sahw and immediately made a sajda after then completed the Salaah. Was I correct or did I have to repeat the Salaah?