Soflyy WP All Import Custom File Download Issue

Instead of custom curl HTTP request I’ll recommend you to use the wp_remote_post() or
wp_remote_get() which internally call the HTTP request and handle all possible errors.

Also use download_url() to download the file and media_handle_sideload() to upload the downloaded file into uploads directory.