I’d also be interested in an answer by someone aware of medieval sources discussing this, which I am definitely not, but I can maybe make a couple of related comments that don’t directly answer the question:
The examples you mention became a particularly notable royal problem largely in the modern, not mediaeval, period. The ‘Habsburg jaw’ and other conditions seemed to develop gradually (see “Is the Habsburg Jaw related to inbreeding?”, Vilas et al, Annals of Human Biology, 2019), but was mainly prominent by the early modern period and especially problematic by the most famous case of Charles II of Spain. The most famous cases of haemophilia derive from the descendants of Queen Victoria, who was a carrier and whose children were married into European ruling families who already had related genes, mostly through her German forebears.
Marrying siblings was always illegal in Christian Europe, with - as far as I know - only one Jean of Amargnac trying his luck at that (of all senior Christian European aristocratic families).
It is entirely plausible that the prohibition of incest derives from genetic concerns - if at least on an instinctive biological level - but I’d defer to others more knowledgeable on this issue. But some cultures have been keen on their royals maintaining pure royal blood through even brother-sister marriages: several Pharaohs (even the ethnically Greek Ptolemies, who were receptive to some Egyptian traditions more than others, especially those that aggrandised their status), the Inca royal family, a few examples in imperial Japan, and the occasional Roman emperor… what these notably had in common was deification, so this was seen as a matter of preserving divine blood, and even broadly biological rules that applied to ordinary humans did not apply to gods. In ancient Zoroastrianism, there was a tradition of ‘Xwedoda’, or sibling-marriage, no longer practised (having been outlawed by Islamic governments in formerly Zoroastrian Persia and other ‘Iranian’ lands).
Cousin marriage was not specific to royalty. Not only was it a lot more common among ordinary Europeans until about a century ago, falling off precipitously around the time of WW1, but it is still legal and practised in many Western countries. Moreover, it is an encouraged tradition in much of the Muslim world (depending on which study applying to a plurality or even majority of marriages in large parts of Pakistan, Afghanistan and Yemen, as well as the Pakistani community in the UK… and yes this has had well-studied and tragic genetic consequences), as well as many orthodox Jewish communities, being seen to keep wealth within the family but not be ‘too’ close and never explicitly prohibited: in the former case even Muhammad married his cousin. Some studies (which I will try to dig up, and differ depending on what is considered a ‘serious’ disorder) put the risk of one child of two first cousins developing a serious genetic disorder as doubling from about 2% to 4% vs. the general population - I would agree this is bad, but as 4% is still ‘low’ in some sense, in the vast majority of cases this will not see negative results unless repeated generation after generation (Charles II of Spain having a higher inbreeding coefficient than if his parents had been typical siblings). So it is expected that the problem would have been worse later in the history of these dynasties than earlier.