Which is why I posted my entirely germaine example.This case, isn't really a case, as it wasn't designed by purpose to defeat the PCs and render them incompetent, without having any other purpose.
The OP questions whether a DM should take into account specific character abilities when setting up encounters.
He designed an encounter that REQUIRED a particular spell.
No PC had that spell & there was no way for them to acquire that spell within the context of the adventure constraints.
By not taking into account the specific abilities of the PCs- here, the lack of a certain spell- he guaranteed that the adventure would grind to a screetching halt.