'Freezing Position Not working on all object Unity

So, I was making a tesla obstacle in my game, and when you get in its range it zaps and freezes the player. However, I have multiple of these teslas and only one of them seems to freeze the player. Here is my code for when the player is caught. rigid is the player's rigid body.

if(sight() && rotate.on){
        rigid.constraints = RigidbodyConstraints2D.FreezePosition;
        caught = true;
        temp = true;
        inBounds = true;
        timer++;
        if(timer > 50){
          temp = false;
          rigid.constraints =  RigidbodyConstraints2D.None;
          Player.transform.eulerAngles = new Vector3(0 ,0, 0);
          rigid.constraints = RigidbodyConstraints2D.FreezeRotation;
          damage.IsAlive = false;
          Debug.Log("dead");
          timer = 0;
          caught = false;
        }
      }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source