You have got to stop believing anything you find on Ancestry, Geneanet and the like. By all means use the information there as pointers, but go for the primary records - those created at the time of the event by or for the people who were actually involved - at Scotland's People.
These record that Samuel Murray and Jan(n)et Johnston(e) had three children, all baptised in Lochmaben, Dumfries-shire between 1767 and 1770. See screenshot from the SP index. There could of course be several more whose baptism records have not survived. So either all these children were illegitimate, or they were married long before 1779. The original records will clarify that point. It seems that the marriage record, if it ever existed, has not survived. This is very common.
How did you get to Samuel M and Janet J? And where did you find that marriage date of 1779?
If Samuel M and Janet J were married before the birth of their son James in 1767, the Samuel born in 1747 is probably too young to be the right one. It was unusual for a young man to be able to support a wife and family at the age of 18 or 19.