First off, the main point of every episode Sector Z (not the delightful children from down the lane) appear in, it’s that any reversal of the imperfect delightfulization process that was used on them is temporary at best.
Second, saying you were surprised at the ending is stupid, because they pretty much said that it was the amulet causing the crazy about halfway through the episode.
Third, the KND are all child geniuses (even Numbah 4. He did end up going to harvard, and Numbah 2 can barely remember his own name by the end). Even if they were all separated, each and every member of Sector Z, who are, by the way, all retired badasses, could get out of this situation with 20 minutes, a box of paperclips, four pounds of fudge and a water storage tank.