$post
is outside the scope of your shortcode function, you have to globalize it first:
global $post;
$sidebar = get_post_meta($post->ID, 'metabox_sidebar', true);
$post
is outside the scope of your shortcode function, you have to globalize it first:
global $post;
$sidebar = get_post_meta($post->ID, 'metabox_sidebar', true);