Let's say that Prince Charles of Wales marries Diana Spencer as otl in 1981. But what happens if he turns out to be sterile?
Completely sterile, as in no or exclusively dead sperms in his ejaculate or are they merely mobility impaired so that an in-vitro-fertilisation might still be an option? If it's the former he could still ask one of his brothers to act as sperm-donor.
How would that effect his marriage to Diana?
He'd be sterile, not impotent, so his relationship with Camilla would still turn his marriage to Diana into the shipwreck it was IOTL.
Would they be granted a earlier divorce?
The problem would be on Charles' side, not Diana's, so at least not for this reason.
Yes, Camilla is the one true love in his life.
Would Andrew still marry Sarah Ferguson?
Likely yes, they knew each other since childhood.