I have found the issue. The BugBranchSet method getBranchesWithVisibleBugs() is flawed.
If returns branches with bugs where the user is subscribed to the bug, but does not check that the user is assigned to the bug. Adding this check makes everything work. The codebase sadly appears to contain similar snippets (but constructed differently to suit the parent query) to check for bug/branch visibility.
I have found the issue. The BugBranchSet method getBranchesWith VisibleBugs( ) is flawed.
If returns branches with bugs where the user is subscribed to the bug, but does not check that the user is assigned to the bug. Adding this check makes everything work. The codebase sadly appears to contain similar snippets (but constructed differently to suit the parent query) to check for bug/branch visibility.