Instantiate not working inside of event

DataRecieved is an event that is called whenever my client receives data. I check if the messages is "Spawn" and then spawn my player prefab it prints "Spawning Player" in the Console but doesn’t instantiate my player.

Why is this?

void DataReceived(object sender, DataReceivedEventArgs e)
{
    string message = Encoding.UTF8.GetString(e.Data.Array, 0, e.Data.Count);
    Debug.Log($"[{e.IpPort}] {message}");
    if (message == "Spawn")
    {
        SpawnPlayer();
    }
}
public GameObject playerPrefab;

void SpawnPlayer()
{
    Debug.Log("Spawning Player");
    GameObject.Instantiate(playerPrefab, new Vector3(0f, 1.66f, 0f),Quaternion.identity);
}