Because the credit data is saved in the attachment’s post meta, not the main post:
$credit = get_post_meta( $post->ID /* Wrong ID! */, 'credit', true );
Instead you need to catch the ID of the inserted image:
function attach_image_credit( $images ) {
$return = $images[0];
// Get the image ID from the unique class added by insert to editor: "wp-image-ID"
if ( preg_match( '/wp-image-([0-9]+)/', $return, $match ) ) {
if ( $credit = get_post_meta( $match[1] /* Captured image ID */, 'credit', true ) )
$return .= $credit;
}
return $return;
}