You could make castes based on measured behavior, not genetic predisposition which is obviously unreliable.
We do this in school by separating kids into different classes according to our guess of their ability. Not very reliable, but it can be better overall than treating everyone equally. We also do genetic "castes" with sports separating males and females. Again, some people end up on the wrong side of the fence but overall it seems to help more than it harms.
I kind of think we should do this in wider society too. As it is, naturally low intelligence or low impulse control people are just thrown in the deep end and expected to compete with people who are biologically superior. They can't win, so all kinds of negative social effects compound, like crime, poor health, poor mental health, and even lower economic success.