Jasper,
The `types` arrays - both particle types and bond types - are not N-length arrays. They are N_types length arrays.
To fix the behavior you are seeing, set:
```
snap.particles.types = ['A', 'B', 'C']
snap.bonds.types = ['AA', 'BB', 'CC']
```
In this way, a bond with typeid 0 is of type 'AA', a bond with typeid 1 is of type 'BB', and a bond with type 2 is of type 'CC'. More generally a bond with typeid `t` is of type: `bonds.types[t]`. Looking at your typeids, you are assigning `typeid` correctly from 0 to N_types.
The reason for the behavior you are getting is that the first 'CC' bond type has id 3, of which there are none in the system. The bond you intended to be 'CC' is actually the second 'AA' type which is inaccessible because HOOMD will always find the first matching string when mapping names to ids.
I will make modifications to both GSD and HOOMD to detect duplicate type name strings and report an error. Feel free to make a pull request extending that how to guide to make it more useful.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan