I don't think the problem is the TPK, I think the problem is "giving them hint" and resurrecting them with some larger than life NPC. The last problem will be further aggravated when they found out that you were just pulling their leg. If the player characters die: Just. Let. Them. Die. It is not that hard, I promise![]()
I definitely think you harm trust most by raising the dead PCs, negating the consequence
of their actions. Particularly bad when it's an Elminster/Paladine come in to save them.
Conversely it's ok to have the PCs defeated & captured, I've done this a few times - they
can then attempt to escape, be ransomed, etc.
If I were you I'd quickly have it revealed they were raised by the Elder Brain, then give
them a chance to escape its control. And next time there is a TPK, let it ride.