Castle Season 07 Episode 16
This episode, Castle gets stuck in a pod on a fake Mars with gas pouring in. Once rescued, he says "Just like in 2001. Kubrick had it right - AI is a bad idea."
Castle is an author. He would have referred to the book 2001 by Arthur C. Clarke and not the movie by Stanley Kubrick.