From Robert Chambers, “Traditions of Edinburgh” (2d ed. 1868), though it also appears in the 1825 first edition; the incident would presumably have occurred in 1782, the year of Lord Kames’s death (though of course we must view all such anecdotes with skepticism):
This able judge and philosopher … is described by his biographer … as indulging in a certain humorous playfulness … and us[ing] phrases of an ultra-eccentric character. Among these was a word only legitimately applicable to the female of the canine species….
When his lordship found his end approaching very near, he took a public farewell of his brethren. I was informed by an ear-and-eye witness, who is certain that he could not be mistaken, that, after addressing them in a solemn speech and shaking their hands all round, … [he,] casting them a last look, cried in his usual familiar tone: “Fare ye a’ weel, ye bitches!” He died eight days after.