Problem with the federation. "SynapseError: 403 - You are not invited to this room"

Hello!

There was a problem with the federation.
Most likely, there was a desynchronization of data in the synapse database.
When I add a user to a group on one RC server, I see error “SynapseError: 403 - You are not invited to this room” in the logs on the second RC server.
In RC, user gets into the room, but in Synapse it hangs in the invite state and must accept it manually.
The user can write messages in RC, but no one will see him on another RC server, since in the matrix he hangs in the invitation state. If you accept the invitation manually through the matrix API, everything starts working. At the same time, direct messages in federation works fine. The problem is only with groups/rooms.

Has anyone encountered such a problem? How did you solve the problem?
Thanks you in advanced

How to ask for help: