But first-cousin marriages generation after generation are not a great idea, as happened in various royal houses of Europe in order to make sure both parents were of noble blood. In fact, it has been estimated that the last Hapsburg ruler of Spain, Charles II, ended up with more homozygous alleles than someone who was the offspring of siblings would. And he had numerous physical and mental problems that were probably the result of it.
Your reply starts with "but", but I don't see the contrast with anything I said? My comment specifically notes that cousin marriage as a recurring practice causes much bigger problems than a single case of cousin marriage in isolation. That note is more than half of the entire comment.
Fun fact: people like to present Charles II as the inevitable result of ongoing inbreeding, but he was noticeably less inbred than more competent historical rulers. Amenhotep I and his great wife had, between them, two parents, two grandparents, and two great-grandparents. Unsurprisingly, he and his great wife turned out not to produce any viable children. Unsurprisingly, that line also experienced early death outside of combat. But surprisingly, they don't seem to have been plagued by mental difficulties at all; as best we can tell from the record, they were very strong kings.
It wasn't first-cousin marriages that screwed up the mainline Habsburgs; it was generation after generation of uncle-niece marriages that did it in. The current branch of the family (Habsburg-Lorraine/Hohenberg) was fortunate enough to avoid that.