In this case, you can only take the exam again until you pass it. The company has regulations. If you fail, the company won't admit you. So, you can only take the exam again, train again and get in. If you keep failing, there is no way out. Only this class will fail.
If the employee is a probationary employee, the entry requirement is that he must pass the company training exam, and if he fails the exam, he will be dismissed, which is applicable to "those who are proved to be unqualified during the probation period" without compensation. If the employee is a full-time employee, unable to do the original job, and dismissed after failing the training and examination, the company needs N+ 1 compensation. It depends on the arrangement of the company, and the system of each company is different.