Nightmare Golem bug

If the Nightmare Golem or any other creature with its trait dies and there are no other creatures alive, the battle ends before his ability activates.