Why the ‘date_query’ is not working in ‘pre_get_posts’ hook?

You’ve got trailing space in your $query->set().

Instead of

$query->set( 'date_query ', ...

it should be:

$query->set( 'date_query', ...