I'm not sure how it works in Scotland, but in England & Wales anyone (including the police) who frustrates or obstructs the execution of a lawful court order is lining themselves up for a world of pain. I can't see that Scotland would be very different in that respect.
There might be mitigation if the execution of the court order would, then and there, result in a real risk to life or limb. Perhaps, also, where there was an obvious fault in the court order where, for example, it was made out in the wrong name or address.
I'm not absolutely clear as to what happened in the Scottish case referred to.