This issue is reproducing only for private documents (i.e. having 'Prevent unregistered users from viewing pages, regardless of the page or space rights' checked on Rights page from XWiki Preferences).
More details are also on the JIRA issue https://jira.xwiki.org/browse/XADIAGRAM-45
@oanalavinia indeed, good point. It's not easy to write a (server-side) migration at this point because the diagram thumbnail is generated on the client side when the diagram is saved (we would have to load all the diagrams in edit mode and save them..). I think it's acceptable to ask the user to re-save the diagram if the PDF export is not good.
Considering this jira issue https://jira.xwiki.org/browse/XWIKI-14204 there are some xwiki versions on which the diagram image attachment won't be added at creation step, so neither the page pdf export will work until an extra edit and save will be performed on the diagram.