There's also the suggestion that the Scottish civil service were effectively 'rouge' with no real oversight from the UK civil service.
Scottish civil service and UK civil service are two entirely separate entities.
You have some UK civil service offices in Scotland including things like HMRC departments, international office, pensions etc but these are separate from Scottish govt civil service.
Scottish civil service report to Edinburgh, UK civil service report to Westminster.