Uploaded image in Block Plugin keeps on getting deleted overnight
As you guessed its must to set permanent while saving the file. You need to include,
    $file = File::load( $fid );
    if ($file) {
      $file->setPermanent();
      $file->save();
    }


  The files will be added to the {file_managed} table as temporary
  files. Temporary files are periodically cleaned. Use the 'file.usage'
  service to register the usage of the file which will automatically
  mark it as permanent.