I was thinking about Wheatly, and specifically his role in releasing Chell and precipitating the events of Portal 2. Now, he's stated to have been designed to make the worst possible decisions in relation to his goal, whatever that may be at the time. In order to accomplish this to the degree desired by the people who made him he has to have some (obviously sub-conscious) knowledge of what many, if not most, of the correct decisions to make would be, and then have those removed as options before they reach his conscious functions. That would make him one of, if not the most intelligent AI constructs we've seen; just with the overriding goal of failure rather than success.
His goal when he releases Chell is the totally self-centered desire to escape the facility. Following the previous line of reasoning it would follow that, in fact, releasing Chell is the worst possible decision he could make given his goal of escape to safety, and so it happens. Isn't it therefore possible that some part of Wheatly predicted at least some of the events, or at least results, that would come of releasing Chell, and it was for that reason that she was awoken. To achieve the worst possible outcome for Wheatly himself, as he is sub-consciously programmed to engineer.
Even after taking over, he continues to engineer his own defeat by antagonizing Chell, and sabotaging the facility, resulting in his destruction whether Chell succeeds or not. I don't think his sub-conscious engineering of events predicted he would end up in space, because honest to god who would, but he definitely seems to me to have been perfectly self-defeating in every regard right up until the end.
In terms of his designated purpose, might he be Aperture Science's greatest success? At least in the field of AI constructs. They make a pretty mean quantum space hole gun too.
Only at Aperture would perhaps their greatest creation also be their stupidest.