RPC Exception - KeyNotFoundException: The given key '2553862054' was not present in the dictionary

Hi, I upgraded my project from an older version to unity 6 and netcode for game objects to version 2.0 and got this exception on RpcMessages line 75.
A lot of other Rpc’s didn’t throw the exception, it only happens when an enemy attacks the player.
The Rpc is called from the PlayerStats script with a NetworkBehaviourId of 7, but the networkBehaviour returned from line 71 of RpcMessages networkObject.GetNetworkBehaviourAtOrderIndex(metadata.NetworkBehaviourId); is the behavior of element 8 (PlayerVisibilityHandler), which causes an exception.
I would appreciate help understanding this.