Colliders not sending information to OnCollisionEnter2D after the scene is reloaded

The player object does interact with the obstacles, but the code that is supposed to be run is simply not working after the scene is reloaded.

Here is my reload code:

    public void EndGame()
    {
        //code being run when player collides with an obstacle (works fine the first time)
        if (!gameHasEnded)
        {
            gameHasEnded = true;
            GameOverUI.SetActive(true);
            Time.timeScale = 0f; //freezes the game
        }
    }

    public void RestartScene()
    {
        StartCoroutine(LoadScene()));
        gameHasEnded = false;
    }

    private IEnumerator LoadScene()
    {
        Time.timeScale = 1f; //unfreezes the game so the coroutine can work
        float fadeTime = GetComponent<Fading>().BeginFade(1); //fades the scene out
        GetComponent<DrawLine>().Reset(); //resets some lines the player has drawn
        yield return new WaitForSeconds(fadeTime);
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }

I don’t see where you put these RestartScene(). You have also too much “)” after starting coroutine LoadScene())). I don’t know what exactly doesn’t work.
So, if you coroutine is working properly, put Debug.Log(Time.timeScale); in Awake and check if it’s working for sure.