Looking at your code (as i do not see any live link to look at). I will assume you are outputting anchor tag inside a button tag (making the HTML invalid). Try the function below instead. Notice that I changed the html from button to anchor tag.
/**
* Add Login/Logout to Menu
*/
function add_login_logout_link($items, $args) {
$redirect_to = home_url();
if( $args->theme_location == 'primary' ) {
$loginoutlink = wp_loginout('index.php', false);
$link = wp_logout_url($redirect_to);
$label="Logout";
if(!is_user_logged_in()){ // user not logged in, show login url
$link = wp_login_url( $redirect_to );
$label="Login";
}
$items .= '<li><a class="btn btn-default" href="'. $link .'">'. $label .'</a></li>';
}
return $items;
}
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
Using Output Buffer
Only use output buffer when you have to. This has potential to create unusal behavior. Here is an example.