That makes a lot of sense for termination. How about hiring? Do you know if the European system specifies what attributes are and aren’t allowed to be considered when it comes to hiring employees?
EU is a collection of many countries with their unique laws, even if the principles might be similar. I can only speak of Finnish law.
Our constitution simply states that no-one can be treated unequally, without acceptable reason, based on race, sex etc etc or any other trait related to the person itself.
So caste discrimination would be illegal here as it is a reason based on the person. The loophole of ”Acceptable reason” there is mostly to allow them to put only people with testicles in mandatory military service without it going against constitution.