Slider value updated in code is not reflected in graphics

I’m having an issue where I set the value of a slider and the new value is reflected in debug statements, but the graphics and values of the slider in editor do not change. I’ve delegated an OnValueChange() function to the slider to ensure that it’s not being changed in any Update() functions.

The slider seems to pick a random value (or at least random to me) to start with. The pictures show changes to the sliders value initiated by the SetValue() function.

What could be causing this?

    public void SetParameters(bool isMainHand, float heatCapacity, ThermalWeaponRanged owner)
    {
        Debug.Log("isMainhand = " + isMainHand);
        Debug.Log("heatCapacity = " + heatCapacity);
        Debug.Log("owner = " + owner.gameObject.name);

        // determines placement of slider
        this.isMainHand = isMainHand;

        thermalWeaponRanged = owner;

        // set speed of handle based on reload speed
        slider.minValue = 0f;
        slider.maxValue = heatCapacity;

        slider.value = 0f;
    }

    public void SetValue(float value)
    {
        slider.value = value;
    }

    // Invoked when the value of the slider changes
    public void ValueChangeCheck()
    {
        Debug.Log("Slider value changed to: " + slider.value);
        Debug.Log("Slider max: " + slider.maxValue);
        Debug.Log("Slider min: " + slider.minValue);
    }

I was storing the script which handled the slider in a variable. To fix the issue I replaced the variable with a GetComponent<>() call.