There are twenty-three types of doubt in prayers; eight of these invalidate prayers, six of them must be dismissed, and nine are valid.
Please refer the link below you find what to do in case of any type of doubt occurs in namaz.
Make sure in all cases of doubts we can’t repeat our Namaz rather we can correct them or ignore them or we can repeat our namaz.
https://www.sistani.org/english/book/48/2239/