Futurama
Insane in the Mainframe
S3 E12:
Fry and Bender become inadvertent participants in a bank robbery and are sentenced to a robot insane asylum where Fry comes to believe that he is indeed a robot.