Validity Of Prayer
If it happens to you frequently as a waswas, then ignore it. When you have a doubt for example in the second and third rakat, take it as the second rakat, complete the prayer, and perform sajda sahw. You need not bother much about it. The principle is that if you can rectify what you missed during the prayer, rectify it, but if you cannot then without rectifying complete the prayer and perform sajda sehw in either case.