TypedDataManager::getPropertyInstance() reuses a prototype object for each child property and list item it builds. It used to key that cache by a string made of the root's data type, the root's settings and the property path. Two separately built map or list definitions with a same-named property shared one prototype, so the second got the first one's class and constraints.
The cache is now keyed by the property or item definition object itself, in a \WeakMap held in the protected TypedDataManager::$prototypes property.
Some contributed code empties the cache by writing [] to $prototypes: through reflection, to work around the bug, or in a subclass that copies core's old clearCachedDefinitions().
The workaround is no longer needed. Writing anything other than a \WeakMap or NULL to the property is deprecated in drupal:11.6.0.
In drupal:13.0.0 the property is typed ?\WeakMap, and writing an array throws a TypeError.
Before:
$property = new \ReflectionProperty($typed_data_manager, 'prototypes');
$property->setValue($typed_data_manager, []);
After:
$property = new \ReflectionProperty($typed_data_manager, 'prototypes');
$property->setValue($typed_data_manager, NULL);
The fix is in drupal:11.6.0 and drupal:12.1.0, but not in 12.0. To keep supporting versions without the fix, write NULL instead of []. That empties the cache on every version, without a deprecation. Once the code requires 11.6 or later on 11.x, or 12.1 or later on 12.x, it can delete the write.
TypedDataManager no longer uses DependencySerializationTrait. That trait only kept the manager serializable until it loaded its data type definitions; after that, serializing it already failed. Now it fails every time, like any other plugin manager.