If player runs out of time and does not kill the required enemies go to the lose scene

Hello, I am creating a game where the player needs to kill a specific number of enemies before the timer runs out. If the player does not kill the number of enemies that he is intended to do so and the timer runs out he will be taken to the lose scene. My problem is that even if the timer runs out and does not kill the required number of enemies he is not taken to the lose scene. How can I resolve this?

EnemySpawer script :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class EnemySpawner : MonoBehaviour {

   
    [SerializeField] GameObject EnemyPreFab;
    [SerializeField] int MaxEnemies = 30;
    [SerializeField] float EnemySpawnTime = 1.00001f;
    [SerializeField] GameObject FirstWaypoint;
    int  CurrentNumOfEnemies = 0;
    int EnemiesToNextLevel = 7;
    int KilledEnemies = 0;
    public LevelManager myLevelManager;
    public static EnemySpawner Instance = null;
    int timesEnemyHit;
  

    IEnumerator SpawningEnemies()
    {
        while(CurrentNumOfEnemies <= MaxEnemies)
        {
            GameObject Enemy = Instantiate(EnemyPreFab, this.transform.position, Quaternion.identity);
            CurrentNumOfEnemies++;
            yield return new WaitForSeconds(EnemySpawnTime);
        }
    }

    void Start()
    {
        if (Instance == null)
            Instance = this;
        StartCoroutine(SpawningEnemies());
        timesEnemyHit = 0;
        if (this.gameObject.tag == "EnemyHit")
        {
            CurrentNumOfEnemies++;
        }
        

    }

    public void OnEnemyDeath()
    {
       /*  CurrentNumOfEnemies--;
         if (CurrentNumOfEnemies < 5)
         {
             // You killed everyone, change scene: 
             LaserLevelManager.LoadLevel("NextLevelMenu");
         }
         */
         
       /* KilledEnemies++;
        if (KilledEnemies >= EnemiesToNextLevel)
        {
            LaserLevelManager.LoadLevel("NextLevelMenu");
        }
        */
        
        if(Time.timer == 0.0f && KilledEnemies != EnemiesToNextLevel)
        {
            LaserLevelManager.LoadLevel("Lose");
        }
        
        
    }
    


}

Timer script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Timer : MonoBehaviour
{
    public Text TimerText;
    public float MainTime;
    public static float timer;
    public  bool CanCount = true;
    public  bool OnlyOnce = false;

    void Start()
    {
        timer = MainTime; //Timer is gonna be equal to what we set MainTime in the inspector 
    }

    void Update()
    {
        if (timer >= 0.0f && CanCount)
        {
            timer -= Time.deltaTime;//The timer will count down in delta time based on the seconds we have 
            TimerText.text = timer.ToString("F");//Converting Timer into a string value 
        }

        //This means that when the timer reaches zero and OnlyOnce is equal to false 
        else if (timer <= 0.0f && !OnlyOnce) //If the timer goes below 0 and OnlyOnce is not equal to flase 
        {
            
            CanCount = false; //CanCount is equal to false so we are not counting down anymore since it's not greater than zero and we can't count anymore
            OnlyOnce = true; //This is goning to be done once when it reaches it 
            TimerText.text = "0.00"; //Setting the UI to 0 
            timer = 0.0f; //Setting the timer to 0
        }

    }
}

I’m confused how/why the Timer class is referenced as Time.timer