How does GameObject.setactive work?

Here you can see exactly what is happening in my game. It works as it should. I have been trying to make a death animation for my character and it works.

My question is, why does it work? Why can I get the components of the Ragdoll when I have disabled it in the top of my script?

Since my ragdoll is the child of my gameObject and the character and ragdoll then both contain parts such as a head, body, arms, and so on. When my gameObject get’s it components shouldn’t it get the arms and legs from both the ragdoll and itself? Shouldn’t this create problems in the loop?

Here is another picture of what I mean with both ragdoll and character named knight containing the same parts.

Here is script:

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class Playerstat : MonoBehaviour {

    [SerializeField]
    private Stat health;
    [SerializeField]
    private Stat energy;
    private GameObject Ragdoll;
    private GameObject Camera;

    private void Awake() {

        health.Initialize();
        energy.Initialize(); 
    }

    void Start() {
        Ragdoll = GameObject.Find("Ragdoll");
        Camera = GameObject.Find("Camera");
        Ragdoll.SetActive(false);
    }
	
	// Update is called once per frame
	void Update () {
        Death(); 
	if (Input.GetKeyDown(KeyCode.Q)){

            health.CurrentValue -= 10;
            
       }
        if (Input.GetKeyDown(KeyCode.W))
        {

            health.CurrentValue += 10;
        }

        if (Input.GetKeyDown(KeyCode.A))
        {

            energy.CurrentValue -= 5;
        }
        if (Input.GetKeyDown(KeyCode.S))
        {

            energy.CurrentValue += 5;
        }
    }

    private void Death() {

        if (health.CurrentValue == 0) {

            Transform[] ragdollbone = Ragdoll.GetComponentsInChildren<Transform>();
            Transform[] currentbone = gameObject.GetComponentsInChildren<Transform>();

            for (int i = 0; i < ragdollbone.Length; i++)
            {
                for (int q = 0; q < currentbone.Length; q++)
                {
                    if (currentbone[q].name.Equals(ragdollbone*.name))*

{
ragdollbone*.position = currentbone[q].position;*
ragdollbone*.rotation = currentbone[q].rotation;*
break;
}
}
}

Ragdoll.transform.parent = null;
Camera.transform.parent = null;
Destroy(gameObject); //does not Destroy gameobject before after finnishing update loop!
Ragdoll.SetActive(true);

}
}
}

It may be because Death is constantly running in Update(). Since it updates every frame, it could be that the second frame occurs so fast that Ragdoll is now an active game object. Try:
if(health == 0)
{
Death();
} else {
// No death
}
or something similar to see what happens.