Hi Tobi,
When attaching user data (of any kind) to Brep components, if you want the data to persist, then attach the data to the underlying geometry, not the topology.
For example, instead of attaching user data to BrepTrim, you’d want to attach it to the trim’s underlying 2D curve instead. Unfortunately, I don’t see a way to get there - I would expect BrepTrim to have a member that returned the index of the underlying 2D curve. I’ve added a request for this to the pile.
http://mcneel.myjetbrains.com/youtrack/issue/RH-33670
– Dale