Instantiate works in editor but not on android

hi everyone,
recently I updated to unity 2023 and the game runs fine and the enemy respawn as usual,
but when I try to make a new script that include Instantiate it wont work on android. it does work in the editor.
I tried to debug the code but every thing is working as it should.

here is the code:

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

public class NextWavesSystem : MonoBehaviour
{
public GameObject Bot;
public Vector3 Positions;
float timer = 15;
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
    timer -= 0.1f;


    if(timer <= 0)
    {
    Instantiate(Bot[Random.Range(0,2)],Positions[Random.Range(0,5)],Quaternion.identity);
    timer = 15;
    }
    
}

}