This is what it says on the Student Awards Agency for Scotland website,
The Student Loans Company (SLC) regulations require a student to provide a National Insurance Number (NINO) before they can receive any Student Loans. In partnership with the Department of Work and Pensions (DWP) and Her Majesty's Revenue and Customs (HMRC), the SLC has put in place processes to help those students who have either misplaced their NINO or do not have one.
Where students do not provide a NINO, the DWP will try to find it and make it available to the SLC. If the student provides the wrong number, then the DWP will correct the number and return it to the SLC.