Just an idea: in 1677, around the time of the marriage of Mary and William of Orange, Anne got smallpox and couldn't attend the cerimony. Not much later, in December, the young baby Charles Stuart (son of James and Mary of Modena) also died from the same disease.
So, WI Anne had died from smallpox, and Mary had got it too, dying not much later? Now James would have lost all his daughters and sons (except princess Isabel Stuart, who IOTL died in 1681). William of Orange wouldn't have an English bride too. How could this situation be developed?