Is it a problem with generation or with viewing the PDF file? If production security is truly the only thing you change, then:
The easiest way to determine where your problem is, is to add a break point after the GenerateDocument action in your microflow, and see if the contents of the FileDocument are set.
In Mendix 5, there was a separate security setting tab called "File Access" which defined security for the entity System.FileDocument. This isn't present in MX6 but perhaps it's related? I had similar problems back then. Check the security for System.FileDoc and its specializations.
This is due to FileDocument permissions as Yudistra suggested. In Mendix 6, nobody has read access to the FileDocument entity directly. Instead, you should create and use a specialization of the FileDocument entity and define your security rules there.