Since I’m not too familiar with your environment I’m just going to list some possibilities.
Check that you’re not using a fat16/fat32 filesystem anywhere. Host, Docker, download location. If this is the cause, exfat is supported by Windows and Linux if you need reverse compatibility.
Confirm you’re running the 64bit version.
Can you determine if the problem starts happening around the 4GB size.
Perhaps there’s not enough free space for it to download and copy the file from the temporary location to the destination at the same time.
Perhaps the file name including the path has become too long.
If you’re not concerned with compatibility with Windows. Replace your filesystem with ext4.
Yeah, fat32 is the devil when it comes to working with large files. (It’s fine for /boot)