entities – Unable to load multiple nodes in a controller

Hi all i am facing issue

$query = Drupal::entityQuery('node');
    $query->condition('status', 'all');
    $query->condition('type', 'mytype');
    $query->sort('created' , 'DESC');

    $entity_ids  = $query->execute();
    $cache_tags = ('node_list');
    $items = ();
    $nodes = !empty($entity_ids) ? Drupal::entityTypeManager()->getStorage('node')->loadMultiple($entity_ids) : ();
   
    

        
                 
    foreach ($nodes as $node) {
        echo '<br>';
        print_r($node->label()); // this will return all values 
      
      $items('title') = $node->label();  // gives only one result
      $items('post_id') = $node->id();
    
          $nid=  $node->id();
        }
     
     
     

        $response = new ResourceResponse($items);
        //$response->addCacheableDependency($build);
       // return $response;

    return new JsonResponse( $items );
  }

Error log shows

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalCoreEntityEntityStorageBase->loadMultiple() (line 266 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).

Anyone please help me