All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Keeping the back perfectly straight in the standing position in prayer is not a condition for the validity of the prayer; however, it is the best manner of standing up in prayer. The spine may be leaning forward as long as the person does not lean to the extent of bowing.
The Hanbali scholar Ar-Ruhaybani wrote:
“Six: standing up straight after the pillar of bowing; the Prophet, sallallaahu ‘alayhi wa sallam, said, ‘And then rise until you stand up straight.’ The least of standing up straight is that the praying person goes back to his posture that he was in before bowing. It does not harm him if he is slightly leaning forward ... because he is still be considered to be standing up. It was underlined above that the sufficient manner of standing up straight in the prayer is for the praying person to not be bowing; and the most perfect manner is to stand up perfectly straight until every vertebra has returned to its place.” [Matalib Uli An-Nuha]
Based on the above, your standing position in the prayer is sufficient and your prayer is valid; there is no need to repeat it. We warn you against Waswas (obsessive doubts); verily, their evil is great. You should ignore them and pay no attention to them whatsoever.
Allah knows best.