Fix for an error that is happening whenever there is a team change.
Made the mod because I had issues in replay mod and the server I play at have AFK system and whenever there is a team change the replay mod crashed at that point.
I saw a mod for 1.20.4 but not for newer versions. The mod: https://modrinth.com/mod/cannot-remove-from-team-workaround