I think it was in the ’70s and I thought it was a Woody Allen comedy movie (but it isn’t Sleeper). I saw it on TV, so it may have been a TV show rather than a movie.
In the scene, a traveler (time traveler?) is walking with his friend, a local guide, on the beach at sunset. They join a group of people at the water’s edge, wailing that the sun (sun god) is leaving them and beseeching the sun to return. Further down the beach is a small crowd jeering the sun worshipers, hurling insults. The traveler asks is friend “who are those guys?”. The friend replies in disgust “Oh, it’s those damn Moon worshipers!”
https://www.imdb.com/title/tt0059095/?ref_=nv_sr_1
Oh my gosh, that’s it. I didn’t expect an answer, so I didn’t check until today. The movie was on Amazon Prime, so I was able to watch it. The dialogue about the sun setting was as I remembered it, but I mis-remembered about who the hecklers were. I don’t think I was able to watch the whole thing because my older brother thought I was too young to watch Ursula Andress, so it’s nice to watch it again. Thanks, I never would have figured it out!!!
Solved! Thanks Mr. Unknown.