Besides the son of Robert Shanks and Agnes Hay, who can be discounted, there is one other David Shanks of roughly the right age in New Monkland in the 1841 census. This is the 12-year-old male servant in the household of Thomas Shanks, farmer, 23, at Drumshangie. In 1851 he is still there, aged 22, and described as the nephew of 37-year-old Thomas Shanks.
In 1881 Thomas was still in Drumshangie, a farmer aged 73 and born in Cadder. It might be instructive to get his death certificate and see who his parents were, and then see if they had a son David or a daughter Agnes?