Had the same issue (more than once) with a huge vendor API. Bad docs, and odd things happen in the API. Only way out is to decompile the code, figure it out, and either document it to write your own high-level objects to interact with the API, and leave the intricacies and gotchas to these impl...