It looks like it sometimes, even though that may not be the case. I've had times when I've corrected ChatGPT, and yes, it knows that what it told me was wrong. It then goes on to tell me more along the lines of what it seemingly already knew what was right.
This obviously isn't the intention of the software, it's just an LLM after all, but there's something missing in the experience when it comes to working with code. Hopefully this sort of issue can be corrected.