Oh dear.
Never trust anything you find online unless it's an image of an original document (and even then be wary because even official documents can and do contain errors), and especially do not trust trees submitted to the likes of Ancestry, MyHeritage, Geni, Geneanet, FindMyPast, Wikitree and 1001 other commercial genealogy web sites out there.
If you find something of interest on one of these sites, follow it up until you find the original source from which the information came. I see, for instance, that there is a very detailed tree on Wikitree, so you could contact the owner of that tree and compare notes. (That tree also gives the date of marriage as 18 December 1824, which is at variance with the record on Scotland's People, so that too would need to be clarified.)
It does sound as if someone has been getting a bit mixed up with the geography! The fact that the 'sources' say 'Castle Douglas' is in itself curious, because Castle Douglas is in the parish of Kelton, county of Kirkcudbright, 52 miles by road from Kirkoswald in Ayrshire. In 19th century terms, when the only way to travel on land was by muscle power, that's about two days' travel. Any original record would come under Kelton, not Castle Douglas.
I've had a look at the Kirkcudbrightshire baptisms and there are no possible baptisms that could be your Agnes the elder, either in Kelton or anywhere else. So wherever that date of birth came from, either it almost certainly wasn't from the original Scottish records or it is the wrong person.