This goof (or mistake) comes from a number 17, season 3 episode called Princess of Space. When the robot moves, it fails to stop, thus, crashing into Jonathan Harris. Mr. Harris looks startled when this happens, but continues acting, being the professional he is.
Lost in Space information:
Lost in Space is an American science fiction television series following the adventures of a family of pioneering space colonists who struggle to survive in a strange and often hostile universe after their ship was sabotaged and thrown off course. It was created and produced by Irwin Allen, filmed by 20th Century Fox Television, and broadcast on CBS. The show ran for three seasons, with 83 episodes airing between 1965 and 1968. The first television season was filmed in black and white, with the second and third seasons filmed in color.
Though the original television series concept centered on the Robinson family, many later story lines focused primarily on Dr. Zachary Smith, played by Jonathan Harris. Smith and the Robot were both absent from the original unaired pilot as the addition of their characters was decided once the series had been commissioned for production. Originally written as an utterly evil but careless saboteur Smith gradually becomes the troublesome, self-centered, incompetent foil who provides the comic relief for the show and causes most of the episodic conflict and misadventures. In the unaired pilot, what causes the group to become lost in space is a chance encounter with a meteor storm, but in the first aired episode, it is Smith's unplanned presence on the ship that sets the ship off course into the meteor field, and his sabotage which causes the Robot to send the ship into a hyperdrive. Smith is thus the key to the story.