The trees themselves are not always accurate. Sometimes they have no sources and are sometimes patently incorrect people are linked as parents and children. (parts of the tree on Family Search linked to my own family are a complete mish mash!) You can use them to find the records.
The baptism linked to Anne (the wife) is in Wood Ditton which is about 15 miles away from Chesterton where the marriage took place. It's possible but of course it might not be the correct Anne Clayton.
These are the full citations to the linked records ( which you can find under citing this record ) You can easily paste these into the source section
thus:
"England Births and Christenings, 1538-1975", database, FamilySearch (https://familysearch.org/ark:/61903/1:1:NB8Y-N36 : 19 September 2020), Ann Clayton, 1677.
"England, Cambridgeshire Bishop's Transcripts, 1538-1983," database, FamilySearch (https://www.familysearch.org/ark:/61903/1:1:6CB1-QCCC : 5 April 2021), Anne Clayton in entry for William Dogget, 2 Jul 1700; citing Marriage, Chesterton, Cambridgeshire, England, Cambridge University Library, England; FHL microfilm