Sorry to resurrect an old thread, but the new ScotlandsPeople site seems to have made it easier to locate women's records under multiple family names they may have been associated with. So on doing a search for Marion Cochrane, I could quickly put together a quite coherent story, albeit one that needs some fleshing out in the details.
1. William Mack/Greig is the son of William Mack, coachman, and Marion Cochrane, who lived in Coull's Close, Canongate. I am not sure when they married - I can find a marriage for Margaret Cochrane and William Mack in the right timeframe, but I am not sure this is them.
2. William Mack died in 1837 just months before his son was born in 1838. This resulted in William Mack/Greig being handed over to his grandmother Euphemia Henderson, then married to Hugh Greig. (Marion Cochrane's death certificate says her parents are William Cochrane, farmer and Euphemia Henderson).
3. William Mack/Greig is bought up by the Greigs until adulthood. He is present on all the censuses with the family from 1841 to 1871, and he is present at the death of Euphemia Henderson, where he is described as her grandson (under the name William Greig). To cement the relationship even further Janet Greig, described as his Aunt, is present in the newly wedded Mack household in 1881
4. Marion Cochrane goes on to marry Robert Mather in 1844, having 3 children James, Mary and Hugh. Robert unluckily also dies young in 1867 at the age of 45 - Marion seems to be rather ill fated in her choice of husbands. She lives with (or nearby) son Hugh until her death in 1891 (called Marion or Minie Mather in the censuses), and he dies a pauper in Edinburgh in 1922. Her death certificate, explicitly says that Marion Mather is the widow of William Mack coachman, and Robert Mather contractor, with daughter Mary Mather as witness.
I think I can see Marion Cochrane in the 1841 census in South Leith, as Marion Mack with daughters Euphemia and Agnes. There is a Euphemia Mack born to William Mack and Mary Cochrane in 1835 in Coull's Close, Canongate, but there William Mack is described as a tailor rather than a coachman, so I am not sure about this.
It would be great to find Marion in the 1851 and 1861 censuses but she is missing (she would be Marion Mather). Then that might confirm the two daughters. Robert Mather is a contractor in South Leith, so her being there in 1841 would fit geographically.
Another mystery is I can find a marriage certificate for Marion Cochrane/Mack to Robert Mather in 1844, but there her father is described as Andrew Cochrane Inn Keeper. Also I can find no references to the marriage of Euphemia Henderson to either Andrew or William Cochrane, which I presume could have predated her marriage to Hugh Greig, but there is a William Cochrane who dies in Canongate in 1813, just prior to her marriage to Hugh Greig in 1814. No idea if this related!
So this is a much more coherent story, albeit with detail difficulties, and certainly goes some way to fitting all the facts. If anyone can find the Mathers in the 1851 or 1861 censuses it would be great, or find evidence of Euphemia Henderson's life prior to marrying Hugh Greig this would be helpful. I note as another oddity that may or may not be relevant, that Mary Cochrane's mother Euphemia Henderson's parents are George Henderson and Euphemia Cochrane.