I think Margaret Laidlaw died young and William remarried another Margaret (Gibb)
Which would explain half siblings on trees for David
As first son he'd likely be named after his grandfather
I think he is on 1881 Wigtown census aged 7 with grandparents David and Agnes and his father william aged 30 aunts and a cousin David age 1 and another cousin or sibling.
Maybe David will turn up later with a relative if he didn't change his name .