EDIT: What I see is Joseph marrying a Portuguese infanta - Teresa Maria of Portugal (who IOTL was betrothed to Charles of Austria before dying in 1704) or her sister Francisca Josefa (https://en.wikipedia.org/wiki/Infant...fa_of_Portugal), and Charles marrying his cousin, Maria Karolina Sobieska, thus being doubly descended from King John III of Poland.