The PUN callback method for the local client's disconnection from all Photon servers is OnDisconnectedFromPhoton().
If this method is called then the local client needs to reconnect to Photon servers first in order to be able to call any other operation.
The PUN callback method for when the local client has left the room is OnLeftRoom(). If this method is called then the local client can no longer call any operations inside the room like SetProperties which is what you are trying to do via PhotonNetwork.room.SetCustomProperties.
The PUN callback method for when a remote client has left the room is OnPhotonPlayerDisconnected(PhotonPlayer player).
The logic you have in ReleaseSlot cannot be executed after OnDisconnectedFromPhoton() or OnLeftRoom(). On the other hand, if you want to call this just before a player decides to leave the room explicitly you will not be handling the cases of unexpected disconnects where the player leaves the room involuntarily.
So you need to change the way you free team slots (or update score?!) when a player leaves the room. You need to do this from one of the remaining players, preferably the master client. However, when the room becomes empty after master client leaving, no one will be left to call ReleaseSlot. Of course, this is in case this situation needs to be handled.
So OnPhotonPlayerDisconnected is a good candidate.
And in case you missed it, my colleague Tobias already posted a comment on the discussion -identical to this one- that you started on Photon's official forum.