This situation illustrates exactly the limitation of AI and why we still need humans in the loop.
It reminds me of a junior coding bootcamp lecture I once gave many years ago before AI coding. One of the first slides said "Computers will do exactly what you say, not what you mean."