Earlier quoted context omitted.
IIRC, there's a way to "force" LLMs to output proper JSON by adding some logic to the top token selection. I.e. in the randomness function (which OpenAI calls temperature) you'd never choose a next token that results in broken JSON. The only reason it wouldn't would be if the output exceeds the token limit. I wonder if OpenAI is doing something like this.
Note that this (token selection restriction) is even available on OpenAI API as logit_bias.
[1] https://github.com/newhouseb/clownfish#so-how-do-i-use-this-...