Class Term missing sometimes when used in myTheme.theme
The error is caused from the fact you didn't fully qualified the class name, which means you forgot the namespace of that class.

Or you use \Drupal\taxonomy\Entity\Term::load($tid); or you add a use \Drupal\taxonomy\Entity\Term; line at the top of the file. In this way, PHP knows where to find the class you reference.