Sprite renders inccorectly on second use of prefab

I’ve been working on a dungeon crawler, and i am currently fixing up some sprite render issues. Unfortunately for myself, I can’t figure out quite what is going wrong.

The first entity out of a spawner triggers correctly, however, every sprite after doesn’t render, even if its hitbox and movement script does. I’ve pasted the code for the spawner and the enemy below. If anyone could tell me why this is happening, I would greatly appreciate it.

Spawner Code:

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

public class EnemySpawner : MonoBehaviour
{
    public GameObject enemyPrefab;
    private GameObject newEnemy;

    public static EnemySpawner Instance;

    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }

    void Start()
    {
        SpawnEnemy();
    }

    public void SpawnEnemy()
    {
        // Spawn a new enemy
        newEnemy = Instantiate(enemyPrefab, transform.position, Quaternion.identity);

        SpriteRenderer spriteRenderer = newEnemy.GetComponent<SpriteRenderer>();
        if (spriteRenderer != null)
        {
            // Set the sprite (ensure that your prefab has a valid sprite assigned)
            spriteRenderer.sprite = enemyPrefab.GetComponent<SpriteRenderer>().sprite;

            // Reset Sorting Layer and Order in Layer
            spriteRenderer.sortingLayerName = "Default";
            spriteRenderer.sortingOrder = 0;

            // Ensure that the sprite renderer is enabled
            spriteRenderer.enabled = true;
        }

        // Access the enemy script and set up references if needed
        EnemyController enemyController = newEnemy.GetComponent<EnemyController>();
        if (enemyController != null)
        {
            
        }
    }
}

Enemy Code:

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

public class EnemyController : MonoBehaviour
{
    private Transform player; // Reference to the player's position
    private NavMeshAgent agent;

    public int maxHealth = 3;
    private int currentHealth;

    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").transform;
        agent = GetComponent<NavMeshAgent>();
        agent.updateRotation = false;
        agent.updateUpAxis = false;

        if (player == null)
        {
            Debug.LogError("Player not found! Make sure to tag your player object.");
        }

        currentHealth = maxHealth;
    }

    void Update()
    {
        // Set the destination to the player's position
        if (player != null)
        {
            agent.SetDestination(player.position);
        }
    }

    void OnMouseDown()
    {
        // Called when the enemy is clicked
        TakeDamage(1); // You can adjust the damage value as needed
    }

    public void TakeDamage(int damage)
    {
        currentHealth -= damage;

        if (currentHealth <= 0)
        {
            Die();
        }
    }

    void Die()
    {
        // Add any death behavior (e.g., play death animation, spawn particles)
        Destroy(gameObject);

        // Trigger the enemy spawner to spawn a new enemy
        EnemySpawner.Instance.SpawnEnemy();
    }
}

Anything that you trigger AFTER the Destroy(gameObject); will not happen since the object that runs the script has been terminated and therefore the script is not running in that gameobject anymore.

Leave the (Destroy(gameObject);t) as the last execution of your code.

void Die()
{
    // Trigger the enemy spawner to spawn a new enemy
    EnemySpawner.Instance.SpawnEnemy();

    // Add any death behavior (e.g., play death animation, spawn particles)
    Destroy(gameObject);
}