In this medieval world, I want to set up a clan system that builds up every kingdom. Every kingdoms will have at least 3-4 big clans/families, each is unique to the theme of the magic they use. For example, clan Warr'og specializes in blood magic.
Magic power is inherited, and people know "exactly" how this works. The offsprings will have, on average, the same average power their parents have.
Parents with 100 and 100 may give birth to children with 90-110 magic power.
They have a magic scale to measure magic power
Of course there will be mutations and special cases, but the system rule is roughly like that.
With this system, people will try to marry a strong wizard to increase the quality of their childrens magic power to rise in rank to the top of the society. The society values magic power highly, so there will be a gap between castes.
I imagine that the society will quickly create a noble class, which will limit the marriage between people in clans to guard their pure blood and secret magic ability.
A noble marrying a commoner will be stripped of their nobility and right and kicked from the clan, because of their "tainting" of the blood purity.
Marriage between nobles are rare, because mixing the most powerful pure-blood always results in the baby's death, because of the incompatibility between two very different magic powers. (A powerful shadow user cannot produce offspring with a powerful fire user, for example.)
So, people will inbreed only within their clan, and this creates a low-diversity gene pool, which will lead to health problems, so they will eventually be wiped out.
With this in mind, is the clan system flawed and not stable? Is there a way to escape the inbreeding, but still maintain the blood purity as high as possible? (Note that it is impossible to get an offspring from marriage of powerful magic users of different school)
Related: This question gives a good insight on why inbreeding is bad: because of the possibility of accumulating bad recessive genes. However, it does not address whether the clan will be wiped out by the inbreeding or will it survive (for at least 10 generations)?