I'm not a lawyer, and especially not a freedom of speech lawyer, but my understanding is that everyone has an obligation to follow the law whatever it might be (modulo intentional civil disobedience). If the law is unconstitutional then it needs to be challenged in court and struck down that way. AFAICT this law is specific to books in school libraries, which might shelter it from first amendment concerns to some degree.
But again, I'm not a lawyer, and just thought it was cool that the district was like "your law is stupid [implied] and a waste of our time, so we're just gonna throw AI at it so you can't blame us for doing nothing".