Automatically Log Out UserX when visiting WooCommerceStore

You should use one of the actions that occur after parse_query, because then the variables on which the conditional tags are based are set. Such action can be template_redirect. The conditional tag will allow you to check if the current page is a store page. To log out the user, use the wp_logout() function.

add_action('template_redirect', 'se344334_logout_demo_user', 9);

function se344334_logout_demo_user()
{
    if ( ! is_user_logged_in() )
        return;

    $curr_user = wp_get_current_user();
    if ( 'DemoUser' == $curr_user->user_login  &&
         (is_woocommerce() || is_checkout() || is_cart()) )
    {
        // destroy user "session"
        wp_logout();

        // redirect to current page after 
        wp_redirect( home_url( $_SERVER['REQUEST_URI'] ) );
        die();
    }
}