Aah its the Title ( sorry i just read dates ).
The code above is just setting the order – by default that is the date value. Which should mean the dated order is correct – they just don’t match your titles.
You can change the orderby to title – by using this instead:
add_action( 'pre_get_posts', function( $query ) {
if ( $query->is_main_query() && ! is_admin() ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
} );
But i am not sure whether that will work correctly when the titles contain numbers.