WESLEY: "You've been chosen to test the M-5, Jim. There'll be a series of routine research and contact problems for the M-5 to solve, plus navigational manoeuvres and the war games problem. If the M-5 works under actual conditions as well as it has under simulated tests,
it will mean a revolution in space technology as great as warp drive. When your crew has been removed, the ship's engineering section will be modified to contain the computer."
Apparently Wesley considered a failure of M-5 not only improbable but rather impossible. And during the first tests the M-5 performed flawlessly. That could explain his "Kirk?!" reaction.