Salah validity for a latecomer who doesn’t follow imam’s sujud sahw
Assalamu alaikum! I’ve got a question about prayer. Suppose a latecomer joins a Hanafi imam. In the final sitting, they recite at-tahiyat and salawat, but they don’t follow the imam for tasleem to the right and sujud sahw. Instead, they stay silent, and after the imam’s final tasleem, they stand up to complete their missed rak’ahs. In their own last rak’ah, they do sujud sahw to make up for the imam’s mistake. Is their salah valid? Also, while waiting for an answer, if the prayer time ends and the prayer turns out to be invalid, would they be sinful for missing it? Should they assume the worst and just repeat the prayer anyway, so they don’t miss the time?