The secretive SNP Government has been exposed by legal advice which insisted it did hold a report on Nicola Sturgeon.