The Scottish Government has lost a two-year fight to conceal the work of a private consultancy firm paid £550,000 in taxpayers' money to advise on the botched National Care Service (NCS).