Random.Range doesn´t seem to be working (or a switch statement)

This script should output a random number every 2 seconds. somehow spawnspeedcount does get raised every 2 seconds but the random output doesn´t show up in log.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Random = UnityEngine.Random;
public class Spawner : MonoBehaviour
{   public float spawnSpeedCount;
    public float countdownTime = 2;
    public float randomNumber;
    
    
    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("OnTick", 2f, countdownTime);
    }

    // Update is called once per frame
    void Update()
    {
         switch(randomNumber)
        {
        case 1:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 2:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 3:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 5:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 6:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 7:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 8:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 9:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 10:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 11:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 12:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 13:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 14:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 15:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 16:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        
    
        }

    }
    public void OnTick()
    {
        float randomNumber = Random.Range(0, 16); 
        spawnSpeedCount += 1;
        randomNumber = Mathf.Ceil(randomNumber);
    }
}

Got it working. It seems like switch got called to early or in a to high frequency. I moved it into the OnTick funktion and replaced UnityEngine.Random.Range() with a random functions from System. I didn´t try moving switch without using Unity Random but I´m trying it later. Code is here:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Random = System.Random;
using System;
public class Spawner : MonoBehaviour
{   public float spawnSpeedCount;
    public float countdownTime = 2;
    public int randomNumber;
    Random rnd = new Random();
    
    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("OnTick", 2f, countdownTime);
    }

    // Update is called once per frame
    void Update()
    {
         

    }
    public void OnTick()
    {
        int randomNumber = rnd.Next(17);
        spawnSpeedCount += 1;

    switch(randomNumber)
        {
        case 1:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 2:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 3:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 5:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 6:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 7:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 8:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 9:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 10:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 11:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 12:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 13:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 14:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 15:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        case 16:
        Debug.Log(randomNumber);
        randomNumber = 0;
        break;

        
    
        }
        
    }
}