I had a similar task where I had to deterministically name an object for replication purposes. I did not have any issues spawning the actor with a specific name though.
// Spawn the loot actor in a net addressable fashion.
// This is important because the loot actor itself is NOT replicated but its reference is sent over the network when player interacts with it.
// We can support this by deterministically naming the actor, thus making it net addressable.
// This way we avoid the case where client-server would not interact with the *same* loot actor (due to spawn order difference).
FActorSpawnParameters SpawnParams = FActorSpawnParameters();
SpawnParams.Name = FName(*GetName().Append(TEXT("_Loot"))); // results in LootNodeInstanceName_Loot
SpawnParams.NameMode = FActorSpawnParameters::ESpawnActorNameMode::Required_ErrorAndReturnNull;
SpawnParams.Owner = this;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;
SpawnParams.bDeferConstruction = true; // code says this is for blueprints only, but its wrong. GetWorld()->SpawnActorDeferred uses this too.
LootActor = GetWorld()->SpawnActor<AFPMLootActor>(AFPMLootActor::StaticClass(), GetActorTransform(), SpawnParams);
if (LootActor)
{
LootActor->SetNetAddressable();
LootActor->FinishSpawning(GetActorTransform(), true);
LootActor->InitFromItem(LootItemId);
LootActor->LinkToLootNode(this);
}
Perhaps your issue is more to do with destroy logic? Don’t forget that actor destruction starts with one frame delay.