I must admit I haven't had the time to play with 3.5's new media galleries and the like, but working off of the code alone without regard to WP's Gallery functionality...
The code you have supplied uses get_children() with the query variable post_parent set to get_the_ID() (the ID of the post object currently being processed in the content loop). As such, the call to get_children() is only capable of querying attachments to the current post, and no others.
In the terminology of your example, your code, when executed in the context of the loop while processing Post#3, cannot retrieve the attachments attached to Post#1 and Post#2 because it is specifically asking for the attachments that are attached to Post#3.
Unfortunately, Wordpress does not support passing multiple values into the post_parent query var, so in order to retrieve the attachments from the other posts in the manner you desire, you would have to obtain the post IDs of the attachment-containing posts (Post#1 and Post#2) and execute a call to get_children() for each, substituting the post_parent value of "get_the_ID()" with the respective ID.
A more efficient (though theoretically more complex) solution may be possible making clever use of the WP_Query object, however I believe that the solution you are seeking (or that I assume you are seeking - you never actually asked a question ;) ) would look something along the lines of
$attachmentParentIds = getAttachmentParentIds( get_the_ID() );
foreach( $attachmentParentIds as $attParentId ) {
$attachments = get_children( array('post_parent' => $attParentId, 'post_type' => 'attachment', 'post_mime_type' =>'image') );
foreach ( $attachments as $attachment_id => $attachment ) {
echo wp_get_attachment_image( $attachment_id, 'medium' );
}
}
which uses a function like
//Returns an array of post IDs containing attachments that should be displayed
//on the post indicated by the passed post ID.
function getAttachmentParentIds( $intPostId ) {
$ids = array();
//Figure out which posts contain attachments that need to be displayed for $intPostID
//...
return $ids; //return an array of IDs
}
as a placeholder for the logic that determines which posts contain attachments that need to be displayed for the passed post ID. I am not positive as to the extent of your implementation nor your application, and as such I know not what the specifics of that logic might entail regarding your project.