As Michiel said:
We use a fixed 30 second timeout for the page to finish loading and rendering. A timeout exception is thrown if the page content did not finish loading within 30 seconds.
Widgets or add-ons for your index.html
file that perform long polling network requests are not supported. The document generation service waits until there are no more pending network requests.
Check also this specific bullet point:
https://docs.mendix.com/appstore/modules/document-generation/#624-timeout-errors
If you really need the complete document and it is complex, there are several avenues to explore:-
I am not sure, but maybe you are experiencing either bullet 3 or 4 of the limitations?
https://docs.mendix.com/appstore/modules/document-generation/#12-limitations