Your test looks invalid? In a real scenario, a program would be calling `json.dumps()` or equivalent, and there would be no way to inject an unescaped quotation mark or linebreak into the ChatGPT prompt.
There's nothing inherently special about quotation marks or newlines, as far as the language model is concerned. With a bit of leadup, you could probably get it to start accepting some other sequence, like <br>, as a line break substitute.
Reinforcement of the response format in various contexts throughout the message have shown to be really effective to me. I specifically use @@@ and &&& as alternative delimiters [0], in the hopes that I'm imbuing the context with more uniqueness, aka something that it won't have seen a million times in training, so that it follows a more specific process.