I couldn't find an Elizabeth Rae and John Tweedie marriage anywhere.
I had another look at James Tweedie' s birth entry, and it suddenly occurred to me that every other entry on the page said 'lawful son (or daughter) of...' except for James', so I think he was probably illegitimate.
His marriage cert has his mother as Elizabeth Tweedie ms Rae, but he married in Ayrshire, so no one would have known if it wasn't true. Also, his wife is described as a 'gentlewoman' on the marriage cert, so, if he was moving up in the world, he could well have wanted to conceal his illegitamacy.
Does that sound reasonable?
I have found an Elizabeth Rae in 1841, but cannot find a suitable John Tweedie, b 1816 anywhere. He is described as a Carter on James marriage cert.