Site icon Hip-Hop Website Design and Development

Class title output earlier than opening title tag

I’m utilizing this code so as to add the class title to the class archive titles:

operate filter_events_title( $title ) {
  // Single venues
  if ( tribe_is_venue() ) {
    $title = sprintf('%1$s Working Race Calendar', get_the_title() );
  }
  // Class pages
  elseif ( tribe_is_upcoming() && is_tax() ) {
    $title = sprintf('%1$s Race Calendar', single_cat_title() );
  }
   
  return $title;
}
add_filter( 'tribe_events_title_tag', 'filter_events_title' );

Whereas the class title is being output, it’s BEFORE the opening tag. How can this be fastened so it’s throughout the tags? This is the supply code:

5K  <title> Race Calendar – Working World</title>