The anachronistic music worked in Knight’s Tale and Moulin Rouge because they served as stand-ins for music that doesn’t necessarily communicate the same emotions and themes to us, as it would have to people in that setting. Young people in Paris at the end of the 19th century liked music that was provactive, experimental, sexy, maybe a little dangerous, just like young people today. But the problem is, the young people of the 19th century grew up to be our great-grandparents, and the stuff that was young and vibrant to them, is old and played out to us. So, substituting the music that they actually played, with contemporary music that carries the same feeling, makes sense. Same thing in Knight’s Tale, where a rousing sing-a-long of “Greensleeves” might have had the same cultural denotation as, “We Will Rock You,” but doesn’t not carry that aesthetic denotation for modern audience.
In both cases, the use of anachronistic music is meant to draw a connection for the audience between their world, and this effectively alien world that they’re being thrust into. Playing “We Will Rock You” during a jousting event communicates, “This is a sporting event, just like going to a football game.” I’m not sure what purpose is served by using “Smells Like Teen Spirit” in a Peter Pan movie. “Smells Like Teen Spirit” at a nightclub evokes a similarity between Moulin Rouge and contemporary (well, late '90s) nightclubs. “Smells Like Teen Spirit” at a carefully stage managed pirate rally evokes a similarity to… I’m not sure what? A night club? My Junior High prom? Is Neverland really even a place you want to make familiar? It’s supposed to be a weird fantasy. I’d think you’d want to emphasize the alienness, not the familiarity.