My animations are messed up

I have a weapon animation system in place. It’s on the 3rd layer, because I need to control the body and the arms too. When I don’t have it equipped, I change the parent (of the weapon) to the FPSController (biggest parent), because then the weapon doesn’t move with the body. When I equip it, the parent is changed to the neck, so that the weapon moves with the camera (camera attached to head which is attached to the neck). I can’t really show you what happens, but the weapon is just EVERYWHERE but where it is supposed to be. Here is my code that controls that:

if (Input.GetButtonDown("Slot" + slot) && !weaponEquipped) {
            animator.Play("equip" + weapon, 2);
            animator.Play("equipArms" + weapon, 1);
            weaponEquipped = true;
        } else if (Input.GetButtonDown("Slot" + slot) && weaponEquipped) {
            animator.Play("unequip" + weapon, 2);
            animator.Play("unequipArms" + weapon, 1);
            if (!AnimationIsPlaying(animator, "unequip" + weapon, 2))
                weaponEquipped = false;
        } else if (!weaponEquipped && !AnimationIsPlaying(animator, "unequip" + weapon, 2)) {
            animator.Play("idle" + weapon, 2);
        } else if (!AnimationIsPlaying(animator, "equip" + weapon, 2) && weaponEquipped) {
            animator.Play("equippedIdle" + weapon, 2);

This function is placed in Update(), and here is my animator layer.
I can confirm that the system works without the parent change and I also did change the animations according to the parents.

I hope someone can help me! Thank you so much!

@TheMatrixAgent22 .yes, my character also has a rocket launcher she has strapped to her back ( parented to torso) and a rocket launcher parented to her hand. when I do the “draw weapon” animation where she reaches over her shoulder, I have both visible so I can line them up and overlap them at the moment the switch needs to take place ( later I do the code for visibility), then when she has grabbed the weapon and in control of her hand she goes into her pose with the launcher. So launcher, rifle, pistol, whatever - the same technique can be applied. Trickier on a large two handed weapon in that you start by placing the weapon in her hand how you want it for use in idles and shooting etc, and work backwards from that animating the reaching for the weapon and making the two line up for the switch