Drupal 8, The file used in the Image field may not be referenced
Check \Drupal\file\Element\ManagedFile for answer, it appears that your file is being saved as permanent, but there is no entry in file_usage table:

if ($file = File::load($fid)) {
      if ($file-&gt;isPermanent()) {
        $references = static::fileUsage()-&gt;listUsage($file);
        if (empty($references)) {
          // We expect the field name placeholder value to be wrapped in t()
          // here, so it won't be escaped again as it's already marked safe.
          $form_state-&gt;setError($element, t('The file used in the @name field may not be referenced.', ['@name' =&gt; $element['#title']]));
        }
      }
    }


If you want to store your files permanently, you need to make sure they've got usage entries, to do so, you can tweak you form submit handler a little bit, here's some quick example:

// get file fid wherever it is
$values = $form_state-&gt;getValues();
$fid = $values['my_file_field'];

// call file usage service and load file
$file_usage = \Drupal::service('file.usage');
$file = File::load($fid);

// set file status permanent
if(!$file-&gt;isPermanent()){
  $file-&gt;setPermanent();
}

// check file usage , if it's empty, add new entry
$usage = $file_usage-&gt;listUsage($file);
if(empty($usage)){
  // let's assume it's image
  $file_usage-&gt;add($file,'mymodule','image',$fid);
}
$file-&gt;save();