Wrong code formatting (specially with diffs)

I’m having serious problems with chatgpt. In many cases, it returns code instead of a block, mixing text and blocks, making the result unusable and forcing me to repeat the question. The issue is that sometimes it gets stuck in a loop and always responds with poorly formatted code blocks. This happens especially when I request a unified diff. I’ve tried different ways to fix it, but it’s quite difficult and unpredictable.