if there is, i am unaware of such a command. You could always use the creation kit to edit whatever NPC you want. I'm pretty sure it's a simple process, just changing an option in the NPC's properties from non-essential to essential.
not sure why it wouldn't work. the only thing i can think of is that you may have had something selected in game before you opened the console and entered the command.
if you have something selected when you open the console there will be a REF ID in the command window for whatever you have selected. make sure there is no ref id when you open the console and you should be fine...good luck.