Yjs with reactflow

Is there any way to switch between groups using same iinstance?
I am working on reactflow with yjs and y-websocket for collaboration…I am using groups for every saved diagram that i create…and collaborate in that diagram using websocket.But when I am switching the diagram the daiagrams between different groups overlaps.
And I am getting this error as well