How to re-publish nodes after unpublishing with hook_cron?
Try to disable access checking in the second run, because after unpublishing the node you might no longer have access to them (depending on the user account the code runs with):

$nids = \Drupal::entityQuery('node')
  -&gt;condition('type', 'event')
  -&gt;accessCheck(FALSE)
  -&gt;execute();