In drupal 9 you can often get errors like this. You should work the OO way of using classes, or use services. Here you can use the service:

\Drupal::service('file_system')->delete($fileLocation);