Drupal custom coding checkout redirect not working
Your fault is want using drupal_goto in form builder!!!

Change your code to this 

 $items['buynow/%'] = array(
    'title' =&gt; t('buynow'),
    'page callback' =&gt; 'custom_module_my_form3',
    'page arguments' =&gt; array(1),
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK,
  );

function custom_module_my_form3() {
   global $user;
   $id=arg(1);
   $product_id=$id;
   $product = commerce_product_load($product_id);
   $quantity=1;
   $line_item = commerce_product_line_item_new($product, $quantity);
   $line_item_added = commerce_cart_product_add($user-&gt;uid, $line_item);
   $order_id=$line_item_added-&gt;order_id;
   drupal_goto('checkout/'.$order_id);
}