wp_insert_post returns int(0)

According to the notes on the codex wp_insert_post()

post_title and post_content are required

If you want the content to be empty, you can write your wp_insert_post args array thus:

$postID = wp_insert_post(array(
    "post_title"  => $name,
    "post_status" => "publish",
    "post_content => " ",
    "post_type" => "mycustomposttype",
), true);