The rewrite rules are correct to add the topic and forum in the URI. If it didn’t, bbPress would not know based on the permalink if you were talking about a topic of a forum. So, that part of it is correct. You have another issue causing the permalinks to not work for the forum. Maybe a .htaccess file one directory up?