retainTreeState is actually going to add new layers. So you select a layer in the catalog tree, then you change the language, and you actually end up with twice the same layer in the map. The same bug actually triggers when you switch topic.