Existing rooms can get messed up if "Use spaces" preference changes
The frontend button to sync rooms with Matrix blindly relies on the "Use spaces" preferences, but groups might have gotten linked to a Space or a Room when the setting had another value.
In that case, it tries to create a new room/space after changing the setting.