Those concerning the first of these two sacraments only concern liceity, but a diriment impediment renders a person incapable of validly contracting a marriage (canon 1073).
The agreement was therefore not validly cancelled, and the court "a quo" ought accordingly to have dismissed the plaintiff's claim for retransfer of the property.