Error after copying the updated files
Some modules still don't have a Drupal 9 compatible release. One option is to install the Upgrade Status module on your Drupal 8 site and resolve all compatibility issues before upgrading to Drupal 9 core.
After enabling the module, you can run the compatibility test from the Update Status UI (under Reports - admin/reports/upgrade-status). The test scans modules for the use of deprecated code, among other things. In the case of deprecated code, it'll tell you the file and line number of the problem so you know what needs to be fixed.
Here's a sample of the results when testing the Allowed Formats module, version 8.x-1.2:

As with any other modifications to contributed projects, make sure to use the project's issue queue and patches to modify the project's code.