[FIXED] Event is null even though value was assigned to it

In a game I’m making I have a script for the win/lose conditions in the level (hence called level script and called “Level_Timed”) and a script to handle the fading out of the level (hence called screen fade script, and called “ScreenFade”). The level script tells the screen fade script to start shutting down the level by an event called “SceneEnds”. The event is defined in a base class of “Level_Timed” called “Level”. In the Awake function of ScreenFade I assigned the event the the appropriate function.

The problem is that when I win/lose the level the things the ScreenFade should do don’t happen. Quick debug reveals that is because the SceneEnds event isn’t assigned and has a value of null.

Relevant parts of Level:

public abstract class Level : MonoBehaviour 
{
	public ScoreTextScript scoreText;
	public delegate void SceneEndsHandler(bool winState);
	public event SceneEndsHandler SceneEnds;
	
	protected int score;
	protected ScreenFade screenFade;

	protected void Update()
	{
		CheckForWinState();
	}

	protected virtual void OnSceneEnds(bool winState)
	{
		if(SceneEnds != null)
			SceneEnds(winState);
	}

	protected abstract void CheckForWinState();
}

Relevant parts of Level_Timed:

public class Level_Timed : Level 
{
	protected override void CheckForWinState ()
	{
		if(!sceneEnds)
		{
			//win condition
			if(score >= scoreGoal)
				OnSceneEnds(true);
		}
	}

	protected override void OnSceneEnds (bool winState)
	{
		base.OnSceneEnds(winState);
		sceneEnds = true;
		base.winState = winState;
		if(shoot.enabled)
			shoot.enabled = false;
	}
}

Relevant parts of ScreenFade:

public class ScreenFade : MonoBehaviour 
{
	public Level level;
	
	private bool sceneEnds = false;
		
	void Awake()
	{
		guiTexture.pixelInset = new Rect(0f, 0f, Screen.width, Screen.height);
		SetAll(false);
		level.SceneEnds += (bool winState) => OnSceneEnds(winState);//here I assign value to SceneEnds yet it acts as if I didn't
	}
	
	void Update()
	{
		if(sceneEnds)
		{
			SetAll(false);
			FadeToBlack();
			if(guiTexture.color == Color.black)
			{
				sceneEnds = false;
			}
		}
	}
	
	public void FadeToClear()
	{
		guiTexture.color = Color.Lerp(guiTexture.color, Color.clear, Time.deltaTime * fadeSpeed);
	}
	
	public void FadeToBlack()
	{
		guiTexture.color = Color.Lerp(guiTexture.color, Color.black, Time.deltaTime * fadeSpeed);
	}

	void OnSceneEnds(bool winState)//no connection to the similarly named method in Level
	{
		sceneEnds = true;
		instruText.GetComponent<DisplayText>().enabled = false;
		if(winState)
			instruText.text = "You Won!";
		else
			instruText.text = "You Lose!";
	}
}

This error occures only on a specific scene, on other scenes the same scripts work fine.

Sorry for the trouble, thanks for the help.

Edit:
Fixed by removing the object carrying the script and putting it again from prefabs, then readjusting it for the level.

I had the same problem and removing the prefab from the scene and adding it again fixed.

Well… it makes no sense but it worked.