How to display only some widgets of a sidebar?

If what you want is “to break up a sidebar over three containers”, then you don’t really need to rebuild dynamic_sidebar() to do it. There is a filter called dynamic_sidebar_params that can be leveraged to break up the sidebar.

function add_closing($params) {
  $params[0]['after_widget'] = $params[0]['after_widget'].'</div><!-- close wrapper-thing -->';
  return $params;
}

add_filter(
  'dynamic_sidebar_params',
  function ($params) {
    static $c = 0;

    if (0 === $c || 0 === $c%3) {
      $params[0]['before_widget'] = '<div class="wrapper-thing" style="border:1px solid white;float:left">'.$params[0]['before_widget'];
      remove_filter('dynamic_sidebar_params','add_closing');
    } else {
      add_filter('dynamic_sidebar_params','add_closing');
    }

    $c++;
    return $params;
  }
);

I found this interesting in a “code golf” sort of way. I am fairly sure that three distinct sidebars, as suggested in comments, is a better way to do this.

This will wrap the widgets in a sidebar in distinct containers, three per container. If you want distinct widget areas what you are doing is entirely the wrong to go about things. It is going to be more confusing than having individual sidebars and it will remove control from the end user. That is not to mention that you will need to largely recreate Core code.

Just use the sidebar system as it was intended.