As far as I understood the problem with my file had nothing to do with rotation of primitive shapes but this is also really interesting. I find this proposition "The image shall match the CAM Program A view of the data" a bit strange because how do you know that the CAM program A views it correctly?
The latest version of the gerber specification defines the conformance for the writer as following:
A conforming Gerber file writer must write files according to this specification. A current conforming Gerber file writer cannot use deprecated constructs. A writer is not required to take into account limitations or errors in particular readers. The writer may assume that a valid file will be processed correctly.
For the reader:
A Gerber file reader must render a valid Gerber file according to this specification. A current reader may support some or all deprecated format elements as they can be present in legacy files. To prepare for future extensions of the format, a Gerber file reader must give a warning when encountering an unknown command or macro primitive; it must then continue processing ignoring the unknown construct. Otherwise there is no mandatory behavior on reading an invalid Gerber file. It is not mandatory to report any other errors – this would impose an unreasonable burden on readers and may result in useless messages in some applications. It allowed to generate an image on an invalid file, e.g. as a diagnostic help or in an attempt to reverse engineer the intended image by ‘reading between the lines’; however, as an invalid Gerber file is meaningless, it cannot be stated interpretation of the file is valid and another invalid. A reader must also give a warning when it processes a file exceeding its implementation limits.
It even had need to make the following clarification:
The responsibilities are obvious and plain. Writers must write valid and numerically robust files and readers must process such files correctly. Writers are not responsible to navigate around problems in the readers, nor are readers responsible to solve problems in the writers. Keep in mind Postel’s rule: “Be conservative in what you send, be liberal in what you accept.”
The articles concludes that the supplied gerber file did not comply with the gerber specification and therefore there will be no obligation for the reader to read it correctly even after the specification was clarified.