Using myDiagram.makeImageData(), the image inside the diagram is lost after downloading as PNG

That is likely a CORS security problem. Search this forum and the web. For example:
Images do not render in call to makeSvg or makeImage
Using makeImageData() function , the image inside the diagram is lost on Download
https://enable-cors.org/
Allowing cross-origin use of images and canvas - HTML: HyperText Markup Language | MDN