I didn't used to penalize people with levels, just that they went back to the start of the XP for that level. But they just kept discarding characters without a care, switching between characters or just getting killed with reckless moves that I tried using this dying rule as an incentive to keep the characters alive. I suppose it wasn't a good idea on the long run as things barely changed and it ended up with a party with a level 8 and four level 5s.
The whole cursed item disaster happened while they were fighting a group of zombies. After getting the sword, there was a room with 18 zombies but while it was a large group it also had one tunnel they could funnel the zombies into. Fighting them was easy despite their number and even became repetitive since the zombies couldn't pass the barbarian to get to the casters at the back and needed a 21 to hit the barbarian that also had resistance. In the end, 18 zombies did 6 damage to the barbarian. Meanwhile he got hit and the curse activated, the Warlock was right behind him and got attacked (random rolled for next target as per the description) and he was soon down. The monk barely got away alive by running away. The druid had the brilliant idea of trying to steal the sword in hopes it would work but Sentinel made it so he could never got away after failing the disarm and was chopped down (all this after the zombies were killed and nobody took damage aside from the barb).
For designing challenges, I look at the CR as a base guideline, then check the abilities and see if they are capable of facing such an enemy. Afterward I throw the enemy at them. Sometimes I throw really easy fights they win without even taking damage, other times I give them harder fights. Once or twice I made encounters that are damn near impossible to beat, but there's always an escape route they can use. If there is no escape, the encounter will always be beatable.
Now I have a little problem in that the barbarian now thinks I'm trying to kill him. I do NOT want to kill my players, there is no fun in that...but after this last session he told me he thinks I'm trying to kill him.
To sum it all up, the start of the camp came with a mission to kill some orcs. Turns out the orcs were the siblings of an orc warchief that has been working for Tiamat. I pretty much based the setting somewhat on the original Dragonlance series. The warchief sent several group of orcs to avenge his brothers, nothing ever life threatening, but in turn they were killing the group's staff and putting others in danger. In the end, they learned the guy had a bounty on his head and decided to nit it in the bud by hunting him down themselves to end the harassment. They found out along the way that the warchief had gathered a small army and kidnapped several villagers in the area. They found a secret way into the fortress and along the way found the cursed sword. Right after that I placed a room with zombies in case they had the idea of attuning to the sword so that they would discover the sword was cursed before entering the fortress. The whole cursed party kill debacle happened and we ended the session.
This next session we had today, the barbarian went back to town and after some incentive from the new characters he got the curse removed. They went on to sneak back into the fortress and went all the way to the boss, a character I made since the beginning based on the main antagonist of the Dragonlance first book, a Cleric of Death (the class from the DMG). Now, clerics of death have an ability to bypass resistances when dealing necrotic damage and after dying he would come back as an undead with a smaller HP pool. The barbarian was the only original party member and the one that killed the boss' brothers so the boss held a grudge and focused mainly him, yet he still attacked the other party members a bit. The fight was rather anticlimatic and when it entered the second stage the barbarian was at low HP...the rest were at either full or half. When the zombie came back I had him be dumb and only there to settle the grudge so he attacked the barbarian and dropped him to 0 for the first time in the campaign. The zombie died in a single turn as everyone rolled well on their damage and he didn't have much HP. The barbarian was stabilized after his first roll by another party member and they were fine.
Now, the barbarian is all pissy at me (passive aggressive style) claiming that I am actively trying to kill him. He says that I gave him the cursed sword which required a Wis saving throw and made an enemy that can ignore resistances all to kill him, as if I had especially designed the villain to just kill him and nobody else. Frankly...I felt insulted...