A typical issue to run on when upgrading to newer Drupal 9 versions is this:

 Call to deprecated function file_save_data():
         in drupal:9.3.0 and is removed from drupal:10.0.0

file_save_data, file_copy and file_move are deprecated and replaced with a service that implements \Drupal\file\FileRepositoryInterface.

Before After
file_save_data() \Drupal::service('file.repository')->writeData()
file_move() \Drupal::service('file.repository')->move()
file_copy() \Drupal::service('file.repository')->copy()