In the original series Star Trek, the episode "The Return of the Archons" (TOS, S01 E21) has a placid, peaceful society with a scheduled time of utter lawless chaos. Several SFF works since then (like the Purge movies) have had similar setups. Was this TOS episode the first use of this idea?
It's not the first, though what follows is, admittedly, an oblique or roundabout answer. Worth mentioning: I consider "Return of the Archons" brilliantly subversive, while not necessarily agreeing with the implications. EDIT: this answer is meant to interpret the episode as shown, with the statements of filmmakers being of interest, but secondary.
The episode's Red Hour refers back to real customs. The closest, from what I've read, is Saturnalia:
In sources of the third century AD and later, Saturn is recorded as receiving dead gladiators as offerings (munera) during or near the Saturnalia. These gladiator events, ten days in all throughout December ... [were later] criticized by Christian apologists as a form of human sacrifice. Although there is no evidence of this practice during the Republic, the offering of gladiators led to later theories that the primeval Saturn had demanded human victims.
Another Roman event, Bacchanalia, is even closer to Red Hour, but Livy's report is contested, and thought to be propaganda. Such rites moderated to the Lord of Misrule, Halloween ("Mischief Night"), and Mardi Gras. This gets into a sensitive area, but it's worth expanding on the connections.
Gene Roddenberry devised the story for "Return of the Archons." He famously rejected organized religion, but was curious and quirky, not necessarily feeling the same about all religions. Finally, his parents were from Texas (he was born there), where "Catholic" meant neighboring Louisiana (and Mexico, of course). Regardless of his stated deflections (IIRC), Red Hour is an extreme Mardi Gras, with leader "Landru" a common name of the region (spelled Landrieu). So is "Tallulah," the likely source for "Tula," the female character.
The episode's cultists wear monk's robes, and obedience equals being "of the body." The latter phrase is Christian generally, but perhaps evocative of consuming "the body of Christ." Roddenberry's memorable reaction to communion (age "around 14"), as told to The Humanist, March/April 1991: "how did Jesus become something to be eaten?"
Thus, if the episode satirizes or slams Mardi Gras as religious rite, Roddenberry and company were following Livy (and others, presumably).
(In terms of actual fiction, the closest I recall is Asimov's "Nightmare," where the regular chaos is very much unscheduled.)