Planned event? I don't railroad characters. They make choices and sometimes those choices lead them to bad ends. You are certainly making a lot of ungrounded assumptions about how I run my games. My players enjoy themselves. Yes, it sucks when a character dies, but it usually isn't the absoulte end and it can result in some fantastic unplanned stories. I often find the unintended consequences are the memorable ones. The carefully crafted DM plotlines and NPC's often fall victim to the greater enjoyment to be had from serendipitous chaos.
If you have a hallway with a hidden pit trap or "bottomless" pit or pit of lava, which were your own examples, and the adventurers MUST walk down that hallway in order to complete their mission-- that is a planned event. Like it or not, the moment you put that there you have planned to have the party do a save or die.
Sure, you could come up with some rationalization like "well, you should do a search check every single time you take a 5' step and poke everything tile you might step on with a 10' pole before taking a step or it is totally your fault because YOU put yourself in that situation!!" If you spend more time rolling search checks than you do anything else, you really have drained all enjoyment out of the game.
And let's say they do start doing that to pleasure you. "HA!! Spikes come out from the ceiling down on you! Save or die!! You said you were checking the
floor. Its your own damn fault for putting yourself in this situation where you weren't checking the ceiling."
When the check the "walls" you make them specify left or right and if they choose the right wall, lava spurts out from the left one! Save or die!!
No, you put that damn pit there intending to make everyone roll a Dex save or die, you have planned to have one party member die. Just because they can't mind read you and know the action you predetermined was the right one to "avoid" the situation chose one of the other dozen possible actions is not "putting themselves in the situation". You are the one who put them there.
Same deal if they need to fight a golem or other large creature that cannot by pushed but can easily push them on a narrow bridge above such an "autodeath" area and the only way around this scenario is to give up on the mission that you NPC assigned them, go home and retire from adventuring. Saying "well, if they go ahead with this it is their own damn fault" doesn't fly-- YOU are the one who chose to set up the scenario in precisely such a way that you mathematically more or less guaranteed that at least one party member was going into that lava. You solely made the choice that the room would be shaped in that way and have that particular hazard combined with that particular enemy.
That is a planned event. You might not call it "railroading" simply because you gave them the option to quit and go home and let the town turn into zombies or let the dragon cult win, but it really is no better.
Or worse, I am willing to bet you are the kind of person who if the players do a search check on a door and roll high, there is never a trap. But the one time they don't roll a search check or roll low, that's the time you are going to claim there is a save or die poison dart trap and if you get tired of them checking every door, then in the next one there is a small bug inside that will leap into their eyeball and burrow its way into their brain killing them if they fail their save.
Those are planned events and claiming that players are putting themselves in those situations and saying it is their fault is just bad rationalizing for your own actions.