Don’t prepend WordPress base url to image paths

You cannot insert remote file in this manner.

<?php wp_insert_attachment( $attachment, $filename, $parent_post_id ); ?>

$filename (string) (optional) Location of the file on the server. Use
absolute path and not the URI of the file. The file MUST be in the
uploads

https://codex.wordpress.org/Function_Reference/wp_insert_attachment

You should first download it to temp dir.

If you wish to keep files on your CDN and simply save URI, consider adding a custom field and saving it there.