create wordpress user on custom post type publish

Try the following code:

add_action( 'transition_post_status', 'wpse_206193_new_user_from_custom_post', 10, 3 );

function wpse_206193_new_user_from_custom_post( $new_status, $old_status, $post )
{
    if ( 'publish' !== $new_status or 'publish' === $old_status
        or 'my_custom_post' !== get_post_type( $post ) )
        return;

    $userdata = array(
        'user_login'    => 'user_name',
        'user_email'    => '[email protected]',
        'user_pass'     =>  NULL,
        'role'          => 'contributor'
    );

    if ( !username_exists( $userdata['user_login'] )  && !email_exists( $userdata['user_email'] ) ) {
        wp_insert_user($userdata);
    }

}

You don’t need to fire that wp_create_user on init or use a separate function in the function.