Problem with PHP shortcode cutting wordpress title

I have tinkered a small PHP code that automatically outputs all posts of the currently displayed category to me via shortcode (except the currently displayed post). So far so good, now my titles are always built the same way “87 lorem ipsum – lorem ipsum”. The code now cuts away the number as intended, but not the text behind the “-“.

Website is: sprueche-fuer-dich.de

Code:

function show_cat_posts_func( $atts ) {
global $post;

$url_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$url_segments = explode('/', trim($url_path, '/'));
$category_from_url = isset($url_segments[0]) ? $url_segments[0] : '';

$a = shortcode_atts( array(
    'category' => $category_from_url, 
), $atts );

$args = array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'category_name' => $a['category'],
    'posts_per_page' => -1,
    'orderby' => 'title', 
    'order' => 'ASC', 
    'post__not_in' => isset($post) ? array($post->ID) : array(),
);

$the_query = new WP_Query( $args );

$output = '';
if ( $the_query->have_posts() ) {

    $output .= '<p class="sidebar-heading-txt">' . $a['category'] . '</p>';

    $output .= '<ul>';
    while ( $the_query->have_posts() ) {
        $the_query->the_post();
        $title = get_the_title();
        $title = substr($title, 3);
        $title = explode('–', $title)[0];
        $output .= '<li class="sidebar-small-txt"><a href="' . get_permalink() . '">' . $title . '</a></li>';
    }
    $output .= '</ul>';
} else {
    $output .= '<p>Keine Beiträge in dieser Kategorie gefunden.</p>';
}

wp_reset_postdata();

return $output;
}
add_shortcode( 'show_cat_posts', 'show_cat_posts_func' );'