Law is so ripe for replacement by AI. It is entirely based on established written arguments with gray areas, edge cases, linguistic subtleties, etc., being the crux upon which many controversial decisions are drawn. That is, law arguments are based on a mastery of language coupled with knowledge of legal precedent. LLMs are extremely good at linguistic reasoning and can be trained on ever legal case every published.
You seem to have the impression that judges follow the law and see where it leads. In reality, judges tend to decide where they want to go and then figure out how to get there.
Judging and litigation will be among the last areas to be replaced by so-called AI, if indeed they ever are. People are infinitely complex and tend to disagree with one another.