As reported in #4257, we use global cache variables to hold entity states and various template data.
The more code uses the cached variables, the more likely it becomes that one part unintentionally write a helper variable to that cache and silently breaks the data contents.
A very nasty example was rP18788, where the consequence was only visible when selecting two temples with a garrisoned mauryan hero healer.
Depends on the order of selection, slightly different tech reseach costs were shown.
The other examples mentioned in the ticket were all Commands.js ones, which were fixed by that C++ commit in rP17673.
The structure tree needs separate investigation.
The simulation components can have their this.entity and this.template property changed (for example fixed by a clone in rP20015),
despite ScriptComponent.cpp rP8865 trying to freeze them. But that must be fixed from the C++ side.