I've found recent versions of Claude and codex to be reluctant in this regard. They will recognise the problem they created a few minutes ago but often behave as if someone else did it. In many ways that's true though, I suppose.
But I have also caught it on straightforward matters of fact and it’ll apologize. Sometimes in an over the top fashion…