I finally went to OpenAI and discussed the issue with it and it explained that you cannot do things out of order as it will interfere with the nesting it tries to output properly formatted XML.