Noted from above "However DNA testing of descendants of James and Walter in the Hamilton Surname DNA Project show that these two did not have the same father. The DNA project shows that the descendants of Walter and his uncle John Hamilton of Fingalton are related, which suggests that James's biological father was not from the same family.[1]"
So, maybe the mentioned Walter Hamilton (of Darngarber, not "of Cadzow") and his uncle John Hamilton of Fingalton were not Hamiltons. Assumptions to the contrary are very risky.
As for the confusion concerning the Hamilton Y-DNA and the Douglas Y-DNA.
In one instance of the Douglas Y-DNA: Y-DNA I-L338 for all of Walter Hamilton of Darngaber's male line? Possibly. (my early Great-grandfather, on my grandMother's side) Y-DNA is possibly I-Y6635 per Descendent of Walter Hamilton of Darngaber, (potentially one of my FTDNA matches). BOTH I-L338 (also known as I1a2a1a1a) and related I-Y6635 (also known as I1a3a1a1a1, Parent Branch: I-Y6624) are of Haplogroup I-M253 also known as I1 (a Y chromosome haplogroup). I-L338 is a well-known Haplogroup of the Douglases.
Walter Hamilton of Darngaber BIRTH 1392 • Cadzow, Lanarkshire, Scotland, DEATH 20 MAY 1441 • Trabzon, Trabzon, Turkey and his descendants were descended from the Douglases and not the Hamiltons.
Sources:
http://dgmweb.net/DNA/Thompson/ThompsonDNA-results.html
https://www.familytreedna.com/public/Douglas?iframe=yresults
http://www.yseq.net/product_info.php?products_id=21060
https://haplogroup.org/ystory/i-y6635/
http://www.personal.psu.edu/faculty/g/a/gah4/HamDNA/B1.pdf