Files could not load after being restored from trash

Background:
The Nextcloud package is installed, using an archive file, on a shared hosting server with some folders connected to S3 buckets for external storage.
Nextcloud version: 18.0.4
Operating system and version: Ubuntu 18.04
Apache or nginx version: Apache 2.4.29
PHP version: 7.4.3

The issue you are facing:

One of my users accidentally deleted the primary folder that was synced to external storage before restoring it from trash. Ever since, he has not been able to load the files within the folder. The size of the entire folder, when downloaded as a zip file is only 5kB; the tar archives within the synced folder could not be downloaded at all. Most notably, opening the pdf files there resulted in a red banner within the browser-based pdf viewer with this error message:

Unexpected server response Message: Unexpected server response (500) while retrieving PDF “https://domain.tld/nextcloud/remote.php/webdav/synced-folder/subfolder/foo.pdf

As server-side encryption was enabled on the installation and the contents of the said folder, were then, successfully loaded, any encrypted folder and its contents could not be directly and successfully downloaded using the web-based bucket control center.

Is this the first time you’ve seen this error? Y

The output of your Nextcloud log in Admin > Logging:

OCP/Encryption/Exceptions/GenericExceptionExemption: Bad signature
Symfony/Component/Routing/Exception/RouteNotFoundException: Unable to generate a URL for the named route "calendar.view.index" as such route does not exist.
Symfony/Component/Routing/Exception/RouteNotFoundException: Unable to generate a URL for the named route "photos.page.index" as such route does not exist.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocnssr8i2s5s',
  'passwordsalt' => 'unsalted',
  'secret' => 'notso',
  'trusted_domains' =>
  array (
    0 => 'domain.tld',
  ),
  'datadirectory' => '/home/ssh-user/domain.tld/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'overwrite.cli.url' => 'https://domain.tld/nextcloud',
  'dbname' => 'honeysuckle_squirt',
  'dbhost' => 'mysql.server.sticky-hosting.com',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'meee',
  'dbpassword' => 'pass12345',
  'installed' => true,
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE