This error occurs when upgrading to Drupal 9

Solution

Change:

$node->field_study_pdf_en->entity->url();

to

$node->field_study_pdf_en->entity->createFileUrl();