How to delete all duplicate node with the same field value in drupal type
If your nodes are not  too many you can achieve it by something like  following   :

$query = \Drupal::entityQuery('node')-&gt;condition('type', "diffusion");
$query-&gt;groupBy('field_id_diffusion');
$nids = $query-&gt;execute();
$nodes = \Drupal::entityTypeManager()-&gt;getStorage('node')-&gt;loadMultiple($nids);

$diffusion_checklist = [];
foreach ($nodes as $node) {
   $diff_id = $node-&gt;get('field_id_diffusion')-&gt;value;

   if (!in_array($diff_id ,$diffusion_checklist)) {
     $diffusion_checklist[] = $diff_id;
   }
   else {
     $node-&gt;delete();
   }
}


And if you have too many nodes  another solution is implement the same strategy with setup a batch operations