The SRA limits the number of retakes to two. This means you have three shots at SQE1 and three shots at SQE2 within each 6 year assessment window.
A worst case scenario is: you pass SQE1, but then fail SQE2 three times. This means you have to start the whole process again within a new assessment window. In other words, you have to wait until the 6 year window expires, and then start the whole process again: SQE1 and SQE2. In other words, if you fail SQE1 three times, or you pass SQE1 but then go on to fail SQE2 three times, then you have to start SQE1 from scratch. You can only do this six years from the date you took your first SQE1 assessment.
In this example, the candidate has failed SQE1 twice, passing on the third attempt. They then fail SQE2 twice. If they pass SQE2 on the third attempt in this example, they will have passed both SQE1 and SQE2 within the 6 year assessment window. If they fail SQE2 on the third attempt, they will have exhausted their attempts for SQE2 within that assessment window, and will therefore need to wait until the end of 6 years from the date of their first SQE1 assessment.