gameObject.setActive(false) is disabling the wrong objects

I have a script attached to my bullet prefab, which is responsible for basic movement and resetting the bullet back to the object pool after a set amount of time, I use Invoke for this.
However when the character starts shooting at first it will work just fine, but after a while bullets start disappearing while there are still other bullets in front of them (alive longer) that keep going, so my first thought is that the bullet that is being reset too early is being reset by another bullet that shouldve reset itself…

Here is the script attached to the bullets:

public class BasicMovement : MonoBehaviour
{
	[SerializeField] public GameObject spellSpawn;
	private Rigidbody objectRigidbody;
	
	public float bulletRange = 2f;
  	public float speed;

	Vector3 _localForward;
   
    	void OnEnable()
   	{
		spellSpawn = GameObject.FindGameObjectWithTag("SpellSpawn");
        	objectRigidbody = transform.GetComponent<Rigidbody>();
		objectRigidbody.transform.position = spellSpawn.transform.position;
		objectRigidbody.velocity = transform.forward * speed;
		Invoke (nameof(DestroyBullet), bulletRange);
    	}
	
	void DestroyBullet()
	{
		gameObject.SetActive(false);
	}
    
}

My object pooler script, here:

public static ObjectPooler SharedInstance;

	void Awake() 
	{
  		SharedInstance = this;
	}
	
    
   	void Start()
    	{
        	pooledObjects = new List<GameObject>();
		for (int i = 0; i < amountToPool; i++) 
		{
  			GameObject obj = (GameObject)Instantiate(objectToPool);
  			obj.SetActive(false); 
  			pooledObjects.Add(obj);
		}


    	}
	public GameObject GetPooledObject() 
	{
		//1
 	 	for (int i = 0; i < pooledObjects.Count; i++) {
		//2
    			if (!pooledObjects*.activeInHierarchy) {*

_ return pooledObjects*;_
_
}_
_
}_
_
//3*_
* return null;*
* }*
Thanks for the help!

@MUG806

I GOT IT!!!
THE staff that fires the spells pivots forward every shot as an animation, now the spawn of the bullets/spells was just infront of the staff, so the staff was actually hitting some of the bullets as they spawned making them collide immediately and despawn!
All I had to do was move the spellspawn forward a little bit so the bullets wont get hit by the players staff when they are spawned in!

What a relief! I knew everything was alright with the pooler and how they are disabled, I have added a failsafe to the Invoke SetActive method, which is:

  private void OnDisable(){
            CancelInvoke ();
        }

This way, if the bullet gets disabled before it had time to call the invoke, it wont try to call it as we cancel the Invocation on disable :D, this probably does nothing, because I suspect OnDisable all invocations are cancelled anyway, but its a nice failsafe either way…

Could it be that you are spawning a bullet, triggering the invoke, but then despawning the bullet due to some other game logic (like the bullet hitting something maybe?), then the same object gets activated for a new spawned bullet, but the original invoke is still waiting, and fires off, deactivating the object? No idea if that is even possible, but just a random hunch.