Can candidates retake the test after they fail?

Yes, candidates can retake the test. You can define the dynamics of test retaking, set the number of allowed test retaking attempts, and the time that needs to pass between these test attempts. You can also set an unlimited number of allowed test attempts.

Here you can find more information on how to enable and limit the test retake option.
Also, you can check this article.