Trouble with DestroyOnLoad,Game won't start after player dies once

I am just starting out, so I’m coding checkpoints into my game and in my script I include DestroyOnLoad. Issue is when the player respawns after the first death, when the player dies the second time, the game keeps running and it’s doesn’t restart.

If this information helps, the game I’m making is from Brackey’s YT tutorial how to make a game playlist. I’m using the game to experiment new things as I learn more.

My Game Manager Script

`using UnityEngine;

using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
 bool GameEnd = false;

public float restartdelay = 1f;

public GameObject youwinUI;

public static GameManager instance;

public Vector3 lastcheckpoint;

private void Awake() 
    {
 if (instance == null)
        {
instance = this;
 DontDestroyOnLoad(instance);
}
else
  {
 Destroy(this.gameObject);
 }
 }
 public void levelwin()
    {

youwinUI.SetActive(true);
    }
    public void EndGame()
    {
  if (GameEnd == false)
  {
GameEnd = true;

 Debug.Log("you lose");
    Invoke("Restart", restartdelay);
   }
   }

void Restart()
{

SceneManager.LoadScene(SceneManager.GetActiveScene().name);
 }
}`

You are not setting the GameEnd variable back to false on Restart. So in the second playthrough its already true so line 35 will never execute.