This happened to me twice today. Look for yourself.
https://chat.openai.com/share/768c9566-d103-4797-9fbb-9d9f2e100e5b
In this chat, it starts writing the code, then pauses for 2 seconds and tries again from the start until it hits the character limit.
https://chat.openai.com/share/181a37c7-6a24-4d8d-94dd-c101b162870a
Here, instead, it forgets what it was doing, and after a couple seconds, splits the codeblock and continues it in a different codeblock.