A Midsummer's Nice Dream - S22-E16
Continuity mistake: The seating arrangements during the Cheech and Chong show keep changing between shots. Smithers is first seen sitting between Patty and Luigi, then he is between Louie and Legs, and then he is between Patty and Luigi again, then finally, he is sitting next to Mr Burns. And Miss Hoover is at first two rows in front of the Simpsons, then she is a row behind them when Homer is going to the stage.
Answer: I'm not sure if this is the one you're thinking of, but an episode of "Ray Bradbury Theatre," called "A Sound of Thunder," dealt with a similar matter: a group of hunters travel back in time to hunt dinosaurs, only to find things have changed when they get back because someone stepped on a butterfly.
Xofer