why when I try to insert an image attachment along with a post does wp_get_attachment_url give me a very wrong file path?

It turns out I was barking up the wrong (or at least a slightly different) tree by using wp_insert_attachment. media_sideload_image managed to pull attachments from other blogs on the same multisite install, copy them to the aggregating blog’s uploads directory, and generate thumbnails, while wp_insert_attachment was doing what it was supposed to, which just happened to not be what I wanted. I realize that this is just a slight variation on other fairly well explained uses of similar functionality, but I figured I’d post my solution here in case anyone happens to have more success applying this particular combination of solutions.

I still get the sense that I’m not doing this in the most efficient way, but it’s working for now:

function switch_and_insert($srcblog, $targetcat, $fromcat) {
  switch_to_blog($srcblog);
  $args  = array( 'numberposts' => 1, 'category_name' => $fromcat);
  $flastpost = get_posts( $args );
  foreach($flastpost as $post) : setup_postdata($post);
    $extrapost = array();
    $extrapost['post_title'] = get_the_title($post);
    $extrapost['post_content'] = get_the_post_thumbnail();
    $extrapost['comment_status'] = 'closed';
    $extrapost['post_status'] = 'publish';
    $extrapost['post_date'] = get_the_date( $d = 'Y-m-d H:i:s');
    $extrapost['post_category'] = array($targetcat);
    $oldid = get_the_ID();
    if ( has_post_thumbnail($oldid)) {
        $filename = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    }
    else $filename = $forchomper; // URL of backup image
    switch_to_blog($aggregator_blog_id);
        $post_id = wp_insert_post($extrapost);
        $wp_filetype = wp_check_filetype(basename($filename), null );
        $wp_upload_dir = wp_upload_dir();
        $attachment = array(
            'guid' => _wp_relative_upload_path( $filename ), 
            'post_mime_type' => $wp_filetype['type'],
            'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
            'post_content' => '',
            'post_status' => 'inherit'
        );
        require_once(ABSPATH . "wp-admin" . '/includes/media.php');
        require_once(ABSPATH . "wp-admin" . '/includes/image.php');
        require_once(ABSPATH . "wp-admin" . '/includes/file.php');
        $sideloaded = media_sideload_image($filename, $post_id);
        $attachments = get_children($post_id);
        foreach ( $attachments as $attachment_id => $attachment );
        set_post_thumbnail($post_id, $attachment_id);
    restore_current_blog();
    wp_reset_postdata();
  endforeach;
  restore_current_blog();
}

It might not be noteworthy, but nevertheless I will mention that using this method provided a very convenient opportunity to apply a placeholder image as a post thumbnail/featured image in the event that the originating post didn’t have one, which is a different solution than the more widely suggested one that relies on a conditional within a theme used to display a placeholder, which doesn’t actually assign it as a post’s thumbnail. I realize that most of the time that is the better solution, but in my case these posts must have their own attached featured images, even if they are duplicates.

Here are a couple of the things that helped:
https://wordpress.stackexchange.com/a/19847/14351
http://old.nabble.com/Uploading-image-attachments-from-the-front-end-td26307647.html