Custom Post Type rewrite

They key thing to understand about rewrite rules is that they only work as long as they are perfectly unambiguous.

You have an idea in your head what example.com/forums/forumname/topic/topicname means so it makes sense to you. When WP gets this URL it has no remote clue what it means, it’s just a bunch of words. Then it goes to rewrite rules and seeks the rule that will “translate” it to the context it does understand (query variables).

So as soon as URL can be explained by more than one rule it all breaks down. For native post types and taxonomies it is all carefully designed so that rules don’t overlap. Such as categories have to have /category/ and so on.

With custom stuff you have more freedom to define things and so more freedom to break things by creating overlapping rules.

So in general you should just avoid any overlap in slugs and such, as much as possible.

If you do need overlap your life gets harder. It is still doable, but you will have to dive quite deeply to debug rules being created. Likely you will also need to construct more tight rewrite rule for your situation from scratch, since “easy” way with registration functions probably won’t cut it.