Line item is getting repeated 4 times even if it is failed

Hi,
I am running a test case for password reset.
Expectation: Password reset will be done from Admin ID & productive password will be set for the training IDs via script. Productive password will be set by logging to the training ID itself.

Expected result: In case, if the training ID is reset with any of the last 5 password again & it should throw error to choose a different password and proceed with next line item.

Actual result: In this case, once we got the error
“Choose a password that is different from last 5 password”, script is running for the same line item again till 4 times & then only moving to next item.
How to change the setting to stop repeating the same line item if it is failed.

Thanks.

How about showing us your code to see any loop structure you may have?