For the next several months, Ana and the school librarian, Amy Rusk, worked to raise $1,000 for his speaking fee. It was not easy — their most successful bake sale netted only $124.

Still, on Tuesday morning at 8:30, Mr. de la Peña walked into the Tucson High library, although there was a surprising plot twist.

On Jan. 1, after a new state law targeting Mexican-American studies courses that are perceived as antiwhite was upheld, it became illegal to teach “Mexican WhiteBoy” in Tucson’s classrooms. State officials cited the book as containing “critical race theory,” a violation under a provision that prohibits lessons “promoting racial resentment.”

For those who have read the book, like Ana, it is hard to figure. In “Mexican WhiteBoy,” the hero’s hope is to become a pitcher on his school’s baseball team.

The novel’s story is pretty much the American dream.

Andrew LeFevre, a state spokesman, said that while the Education Department had found the Mexican-American studies program out of compliance with the law, it was the Tucson district’s job to decide how to enforce the ruling. “I think the district said: ‘Let’s be safe and collect this material. We don’t want a teacher from Mexican-American studies to use it in an inappropriate fashion.’ ” he said.