Yeah, it is a huge frustration but I understand it. The HomeKit devices are linked to the encryption key that the iOS devices generates, if a new key is generated, the bridge (and other HomeKit devices) no longer recognize that account. This is an issue that definitely needs to be addressed. I think some of it is the implementation of the HomeKit keys, as well as the lack of backup options for HomeKit devices. Both sides are at fault, IMHO.
I found that setting up all HomeKit devices to basic functionality (linking, room hierarchy, home name, etc.) while logged out of iCloud was the only way to avoid the Error 77. Once I had all HomeKit devices synced and functioning without being logged in, I would "lock" the account by signing into iCloud and Keychain. This almost always generates the Error 77 Data Sync issue. I had luck and cleared it with the Reset Network Settings. After that, I was able to configure scenes and such... After that is when I went through and gave devices names and started setting Hue colors, etc.
I know this is a painful process. I went through it MANY times. The silver lining is I have learned to reprogram my home very quickly. This is good practice in case of a failure or something, but it was a chore I found very annoying and a waste of time. There is still much room for improvement in the HomeKit ecosystem but we have to remember this is brand new technology.
I feel the pain of everyone struggling with configuration. I encourage you to plow through it though, the results are remarkable and it CAN work as advertised. I have been enjoying a flawless automated home for the last week.😀