Memory Leak Patch is semantically wrong
The patch to RepositoryComponentSwitch from 1 year and 4 month ago fixes a memory leak but fails semantically as in principle due to the possibility that assembly contexts can be created and removed in the global PCM model FQIDs should always be computed based on the request's local copy.
As Steffen sumarized, the issue has been fixed by reverting the calculation of the FQComponentID to using the local PCM model. To prevent the previous memory leak from occuring a string concatenation of the assemblies' IDs is stored in the simulation instance instead of a stack of model elements
After checking out the patched code, my example model works again. It seems it is resolved now.
Analyzing the issue with Sebastian Krach, we figured out the the issue can be resolved by using String IDs in the SimulatedComponentsRegistry. This class caused the memory leak by using lists of Assembly Contexts pointing to PCM local copies which are released only after simulation runs fully complete. Sebastian is about to implement a patch. I have a test model to validate the patch afterwards.