How to attach node into panelized node?
Here is a better approach by using the following function which uses modifies display in node it-self:

/**
 * Attach node into panelized node.
 *
 */
function example_attach_node_to_panelized_node($pnid, $nid, $region = 'middle') {
  $result = FALSE;
  $node = node_load($pnid);

  // Set default region based on layout.
  if (!$region) {
    switch ($node-&gt;panelizer['page_manager']-&gt;display-&gt;layout) {
      case 'landing_page':
        $region = 'primary';
        break;
      case 'sub_landing_page':
        $region = 'main';
        break;
      case 'bootstrap_threecol_stacked':
      case 'onecol':
        $region = 'middle';
        break;
    }
  }

  if (!$region) return; // Check if matching type.

  $panes = array();
  $my_block_pane_exists = FALSE;

  // Load the display.
  $display = $node-&gt;panelizer['page_manager']-&gt;display;
  $did = is_numeric($display-&gt;did) ? $display-&gt;did : example_resave_display($node);
  if ($display = panels_load_display($did)) {

    // Check if our pane is already there, if so, ignore the further processing.
    $panes = $display-&gt;content; // Get this display's panes.
    foreach ($panes as $pid =&gt; $pane) { // Loop through and add in our new pane.
      if ($pane-&gt;type == 'node' &amp;&amp; $pane-&gt;subtype == 'node' &amp;&amp; $pane-&gt;configuration['nid'] == $nid) {
        // If our node already exists we can skip this.
        $my_block_pane_exists = TRUE;
        return FALSE;
      }
    }

    // Attach our new panel.
    $uuid = ctools_uuid_generate();
    $new_pane = panels_new_pane('node', 'my_node', TRUE);
    $new_pane-&gt;uuid = $uuid;
    $new_pane-&gt;pid = "new-" . $uuid;
    $new_pane-&gt;panel = $region;
    $new_pane-&gt;shown = 1;
    $new_pane-&gt;configuration['nid'] = $nid;
    $new_pane-&gt;configuration['build_mode'] = 'teaser';
    $new_pane-&gt;configuration['link_node_title'] = FALSE;
    $new_pane-&gt;configuration['links'] = FALSE;
    $display-&gt;panels[$region][] = $new_pane-&gt;pid;
    $display-&gt;content[$new_pane-&gt;pid] = $new_pane;
    // Or: $display-&gt;add_pane($new_pane, $sourcePane-&gt;panel);

    if (!$my_block_pane_exists) {
      // Finished reordering pane's and save the panelized node.
      $node-&gt;panelizer['page_manager']-&gt;display = $display;
      $node-&gt;panelizer['page_manager']-&gt;display_is_modified = TRUE;
      $result = node_save($node);
      // Clear ctools caches.
      ctools_include('object-cache');
      ctools_object_cache_clear('panels_node_display_cache', $pnid);
    }
  }
  return $result;
}


In case the display is not initialized yet (it's in new state), you've to re-save the display in order to perform above operations.

/**
 * Re-save panelizer display.
 * See: https://www.drupal.org/node/2537006
 *
 * @param
 *   $nid (integer)
 *     panelized node id
 *
 */
function example_resave_display($node) {
  $node = is_numeric($node) ? node_load($node) : $node;
  $display = !empty($node-&gt;panelizer) ? $node-&gt;panelizer['page_manager']-&gt;display : FALSE;
  if ($display &amp;&amp; !is_numeric($display-&gt;did)) {
    $new_display = panels_save_display($display);
    $node-&gt;panelizer['page_manager']-&gt;display = $new_display;
    $node-&gt;panelizer['page_manager']-&gt;display_is_modified = TRUE;
    node_save($node);
    ctools_include('object-cache');
    ctools_object_cache_clear('panels_node_display_cache', $node-&gt;nid);
  }
  return is_numeric($new_display-&gt;did) ? $new_display-&gt;did : FALSE;
}


Sample usage:

example_resave_display(800); // Use only in case the node is new.
example_attach_node_to_panelized_node(800, 123);
example_attach_node_to_panelized_node(800, 124);


See also: Updating Panelizer content programmatically which the above functions were based on it.