Cannot view taxonomy terms for one vocabulary

I’m running core 8.9.16 (and have run database updates) and have 24 vocabularies. One is giving me an error when I try to list terms, the others are fine. This seems to have happened when I updated to 8.9.1. But when using the contrib taxonomy manager module, I can list the terms. I don’t know if this is a core issue, or perhaps corrupted data in the table. I’d appreciate any tips on how to solve this. Here’s the error screen:

Error: Call to a member function id() on null in DrupaltaxonomyTermStorage->loadTree() (line 276 of core/modules/taxonomy/src/TermStorage.php).

DrupaltaxonomyTermStorage->loadTree('team_member_types', 0, 1, 1) (Line: 177)
DrupaltaxonomyFormOverviewTerms->buildForm(Array, Object, Object)
call_user_func_array(Array, Array) (Line: 532)
DrupalCoreFormFormBuilder->retrieveForm('taxonomy_overview_terms', Object) (Line: 278)
DrupalCoreFormFormBuilder->buildForm(Object, Object) (Line: 91)
DrupalCoreControllerFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
DrupalCoreEventSubscriberEarlyRenderingControllerWrapperSubscriber->DrupalCoreEventSubscriber{closure}() (Line: 573)
DrupalCoreRenderRenderer->executeInRenderContext(Object, Object) (Line: 124)
DrupalCoreEventSubscriberEarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
DrupalCoreEventSubscriberEarlyRenderingControllerWrapperSubscriber->DrupalCoreEventSubscriber{closure}() (Line: 151)
SymfonyComponentHttpKernelHttpKernel->handleRaw(Object, 1) (Line: 68)
SymfonyComponentHttpKernelHttpKernel->handle(Object, 1, 1) (Line: 57)
DrupalCoreStackMiddlewareSession->handle(Object, 1, 1) (Line: 47)
DrupalCoreStackMiddlewareKernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupalpage_cacheStackMiddlewarePageCache->pass(Object, 1, 1) (Line: 85)
Drupalpage_cacheStackMiddlewarePageCache->handle(Object, 1, 1) (Line: 47)
DrupalCoreStackMiddlewareReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
DrupalCoreStackMiddlewareNegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
StackStackedHttpKernel->handle(Object, 1, 1) (Line: 708)
DrupalCoreDrupalKernel->handle(Object) (Line: 19)

Here’s what I’ve found running it through debug (in phpStorm); line 276 is

if (isset($this->treeParents($vid)($load_entities ? $term->id() : $term->tid))) {

$load_entities is true
$term is null, though

In line 275, $term is loaded:

$term = $load_entities ? $term_entities($child) : $this->treeTerms($vid)($child);

$child is set to 54, which is a non-existent term. The term was somehow deleted. I don’t recall deleting it. It is set in line 270:

$child = current($this->treeChildren($vid)($parent))

and it is set to 54 at the end of the loop by looking at the next value. The values in $this->treeChildren($vid)($parent) are 53, 54, 67, 72, 68

If this is mangled data, how do I remove the 54?