Missing images in response from CURL request in Modx snippet

Ok, this is a tricky one. Using Modx 2.8.4, I am running a simple CURL request in a snippet. The response data is raw HTML, not JSON. This is the code of the snippet:

$ch = curl_init('https://www.foosite.com'); 
$apiresult = curl_exec($ch);

It’s just about getting the result and instantly display it on the surrounding website where the snippet is running. I keep having the strange error that only the first ~8 images of the requested website are transferred and displayed properly. All others images (IMG tag) are either missing or replaced by a 1px x 1px base64 encoded image!? The funny part is, that I tested the same request on another server (Node.js and no MODX environment) where everything works fine: the CURL response contains the entire website correctly, including all images. Hence, I suspect the error to be connected to either my Modx configuration or the configuration of the webserver hosting it. It might be worth mentioninig that the requested website is big, about 7 MB in size, so I thought maybe I am running into some sort of transaction size limit or timeout? But where? I tried fiddling around with GZIP compression but that did not help. I don’t think it’s the PHP execution time since the website itself is fully transferred and not truncated. It is just the majority of images that is missing. I am running out of ideas.

Maybe the site you requesting (https://www.foosite.com) has some sort of lazy loading implemented.
I doubt this has anything to do with MODX.

Ok, good point, but then why is it working on another server where I do pretty much the same thing: grabbing the HTML and display it? Currently, I try to consider all elements involved along the communication chain: server configuration, Modx configuration, HTACCESS file, …

It seems to have something to do with the configuration of CURL, such as USER Agent. I noticed that I get different results (responses), depending on the CURL configuration parameters. Just to let you know and maybe interesting to whoever might be tackling this issue in the future.