Our immediate thought might be that Samuel and Mary had been cohabiting and had married as soon as possible after their first child was born which would, in Scottish Law, have made him legitimate, despite the fact that his birth record says 'illegitimate'. But the facts may not be quite as we first imagine. The couple may well have planned to marry before they had children, but Samuel's father William was in fact drowned in a Canal near Temple Bridge, in the Parish of New Kilpatrick, on 12th October 1865 and this tragedy may well have delayed any wedding plans. Samuel (who married Jane) was one of four full siblings born to William Gage McIlhaggie and Mary Houston, namely Rebecca, Henry, Samuel and Margaret who gave notice of her father's drowning. Samuel had three full siblings and I think three half-siblings as his mother Mary Houston had I believe been married twice, the first time to William Gage's elder brother John. He and Mary had had another Henry, then Eliza and William. We know from William Gage McIlhaggie's death record that his parents were Henry McIlhaggie or McIlhaggo and Mary McDole or McDowel. Henry in his turn was one of probably four brothers born in the late 18th Century in Maxwell's Walls, the townland in the parish of Connor in County Antrim, Northern Ireland.
PS: I do not know what became of the children of Samuel and Jane. A correspondent has found the surname McIlhaggie in Hamilton County, Ohio, USA, Surname Registry. I will document the second 'stray' family I have found in the Scottish Censuses in a subsequent blog.