This is why I don't use AI to write code directly but instead will use it to generate code snippets or ideas or critique, or even just use it as documentation I can talk to.
By doing this I can still get the benefits of the technology including - and this is crucial - as a learning aid to improve my own skills, while not entirely outsourcing my own thinking to the machine.