Did you look to see where Mary Lyon was in 1851? I have found what looks like her at Shore Street, Fraserburgh, Buchan, Aberdeenshire.
Interestingly she is listed as Mary Lyon, married and under her name is what I reckon is her sister Isabella Lyon who is unmarried.
Mary's birth year is given as 1826 born Cullen, Banffshire. The head of the household is Alexander Oliphant (born 1830) a grocer and spirit retailer.
Rather annoyingly Mary is not with the family in the 1841 census although Isabella is.
I think you may find that for whatever reason, Mary and David never actually married.