Trying to make sprite's alpha decrease to 0 in order to make it dip to black but it seems to be randomly glitching out

First things first here’s the code:

IEnumerator FadeToBlack() {
		Debug.Log ("hi");
		mySprite.color = GameObject.FindWithTag ("PlayerBase").GetComponent<ColourMaster> ().worldColour;
		Color TempC = mySprite.color;
		float speedFade = 5f;
		while (mySprite.color.a > 0f) {
			TempC.a -= (0.01f * speedFade);
			mySprite.color = TempC;
			yield return new WaitForSeconds (0.01f);
		}
	}

First of all, the coroutine isn’t being spammed. The debug message only appears once, meaning the coroutine is only started once. After it does start, the object’s sprite renderer (mySprite) has its color defined. Then some other thing are set, like a temp color variable. Then I start a while loop that runs while the alpha value is greater than 0. As TempC’s alpha is lowered, mySprite.color is changed to TempC. In theory, this is supposed to lower the alpha of the sprite until it is 0. Next, the object is destroyed (a timer is elsewhere on my script and functions properly), independently of this coroutine. However, the observed effect is that the alpha value seems to pick random values every frame. Visually, this looks like the object’s sprite is glitching out and flickering. Does anyone know how to fix this? Any help would be greatly appreciated.

I suspect it has to do with something else in your project, or perhaps the way you are invoking it?
I created the following test script decrease a color’s alpha, and it worked as expected. Of course, this is the ONLY script in the test project, so I know nothing ELSE is changing the color. ( I also used just a member color variable, rather than another object’s sprite’s color, to simplify things- so the way you select the sprite might also have something to do with your issue.) But this should be proof enough that the coroutine is being invoked, when/as expected.

public class corouttest : MonoBehaviour {

    public Color aColorValue;

	void Start () {
        StartCoroutine(FadeToBlack());
    }
    IEnumerator FadeToBlack()
    {
        Debug.Log("hi");
      //  mySprite.color = GameObject.FindWithTag("PlayerBase").GetComponent<ColourMaster>().worldColour;
        Color TempC = aColorValue;
        float speedFade = 5f;
        while (aColorValue.a > 0f)
        {
            TempC.a -= (0.01f * speedFade);
            aColorValue = TempC;
            Debug.Log("fading: " + aColorValue.a);
            yield return new WaitForSeconds(0.01f);
        }
    }
}