Under Scottish Law, unlike English Law, a birth became legitimate if the parents subsequently married one another. In this instance, you should find a Record of Corrected Entry (RCE) or a re-registration for the birth. The exception here is if the baby was born as a result of an adulterous relationship. The birth would not then be legitimized even if the parents subsequently married.
Up until the late 1800s illegitimacy was often a matter of course. It was not until the late 1800s, early 1900s that illegitimacy was seen as a social stigma.