If you can't pass the exams, then you are
even basic skills you are not in this profession. The curriculum in every technical high school is just a "lick" of the profession.
So if you have not learned at least a sufficient level, you do not need a diploma anyway, because nowadays only your knowledge, skills and experience count for the employer.
So you may not have a diploma and earn very well, but you have to be a "real professional". And here the circle is closed in your case.
But it's not a catastrophe. You can develop all your life. Just pull yourself together, leave your classmates behind and start learning. Take the exam next year, and in the following years keep increasing the level of your knowledge by completing various trainings and learning by yourself. In a few or a dozen years it will turn out that you have reached a level that is difficult for your other competitors to achieve.
I have a friend who only at the age of over 40 did his high school diploma and later engineering studies to be currently a department director in a very large international company. His employer forced him to do so, because it looked bad that a director without a high school diploma was managing a team of several hundred engineers and technicians.