The growing use of artificial intelligence in court cases risks bogus laws being cited as fact, Scotland's top judge has warned.