Scots law. It is common law, that is it has been created by judges, in this case Scottish ones. It still exists although 'attempting to pervert the course of justice' covers the same ground. That it itself a common law offence but invented by English judges. It has been adopted in Scotland though no case of it was reported there until 1946.
The Scots prefer their own version when the attempt is much closer, much more closely related to, an actual trial. Thus in 1846 two men were convicted of it when one fraudulently claimed to be the other, to the extent of appearing in the dock, before the fraud was detected. Attempting to pervert may be no more than deliberately giving false information to the police put them on a false trail; there may be no criminal proceeding in progress or instituted.