Teams problem with students making own groups

Problem description:
When student click to make their own groups or join a group, it tells them they are already in a group. But they are not. This happens about 10% of the time my students try to make groups. All other times it works as intended. I’m not sure why it’s inconsistent.

Expected behavior:
Students click the “make group” button and it makes a new group.
Students click the “join group” button and they can see available groups to join.

Actual behavior:
Students get error message saying they are already in a group.

Steps to reproduce:
I never know when this is going to happen. It’s totally random.
Here are videos of the problem:
https://drive.google.com/drive/folders/1poXmCV3B3kxdJSgJaaWRtz1CNJ6bJSdh?usp=sharing

Bug appears at this link:
https://replit.com/@CSP22/Bar-Graphs-in-Matplotlib#main.py

Browser/OS/Device:
Chrome