I think people don't understand well the way things like 'taking a position which agencies to eliminate' are reached. It's mostly about the political reception the point is expected to get in the campaign, and it's heavily determined by 'outside influences'. A candidate is rarely going to sit down and do some big study on what to eliminate. Rather, he's like to want to be 'bold' on some plan for it and have his political advisers help determine what will get the most votes.
That's an issue in democracy - if the voters are a bunch of yahoos who want to gut a good department, they're likely to get a candidate who champions the idea.
Candidates are constantly having to weigh when voters want something misguided with being responsible leaders against it - and pandering tends to win.
I think people often incorrectly think a lot of the 'candidate policies' are just created by the candidates. They have no shortage of suggestions for those policies.
A few presidents have done more their own thing, but even they have been more influenced than is often realized. For example, JFK had a lot of 'his' unique programs, but really, you can find other influences for most - events pushed him to adopt civil rights, 'Alliance for Progress' was from people like Richard Goodwin, the Peace Corps I forget who the influence was, oops, the space race had plenty of influence and was largely a reaction to the USSR, etc.
The issue with Rick Perry here is far less that he couldn't remember the name of the agency, than that he supports eliminating the department of energy when energy is a crucial issue for our country in the first place at a time we drastically need good plans for energy. It's a sad commentary that a debate gaffe hurts him far more than bad policy.