How can you change the temporary directory?
In https://www.drupal.org/node/3039026 / https://www.drupal.org/node/3039255, which was introduced in Drupal 8.8.0, the ability to configure the temp directory was removed from the UI and moved to settings.php.

From the change record:


  The following lines are now in default.settings.php

/**
 * Temporary file path:
 *
 * A local file system path where temporary files will be stored. This directory
 * must be absolute, outside of the Drupal installation directory and not
 * accessible over the web.
 *
 * If this is not set, the default for the operating system will be used.
 *
 * @see \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory()
 */
# $settings['file_temp_path'] = '/tmp';



So, you should edit your settings file.

If your temp directory is different in your environments, you need a mechanism to handle this.  I typically use .env files for this, the database connection info, and some other settings.