Yes there is truth and I know someone who served at Stirling Castle when it was a barracks who can attest to it.

But it would not have applied in all Scottish regiments as not all of them were issued with the kilt - the lowland regiments in particular who were issued with trews instead.

Now with all the amalgamations into the one "super regiment" such differences no longer apply but kilts are considered to be for ceremonial occasions only. Whether or not kilt checks are still carried out for such occasions I cannot say.