Some further analysis:
The whole "Prime Directive" discussion is rather reminiscent of the TOS-era interpretations that prohibit even the rescue of doomed cultures, interpretations that are patently
meshuga. (And indeed, that's one of the few areas of discussion in which CLB and I have come out in complete and open agreement with each other.

)
It's definitely not a retread of TNG: "Justice" -- there, the "surprise death penalty" happens in Act 2. It's a better fit for TNG: "Justice," where it doesn't happen until Act 4, but still, it's not a particularly good fit, because death isn't seen as a penalty here. If anything, it's more like TOS: "Amok Time," where it's not revealed until T'Pau's matter-of-fact "This combat is to the death."
Really, if anything, it's a "tomato surprise death ritual" story, in which we (and Burnham, and Tilly) don't know that the "winner" is to be killed, very much in the vein of Shirley Jackson's masterpiece, "The Lottery." Except that in "The Lottery," nobody is in any particular hurry to "win" the titular lottery. I've read "The Lottery" many times, and I rather enjoy watching the reactions when a "Lottery virgin" gets to the ending, but here, the foreshadowing is much more subtle, and the people are actually enthusiastic about the prospect of being the human sacrifice, even though they presumably are well aware that they're racing to their own deaths. I
think ST has done this combination of tropes before, but no specific examples,
complete with people competing for the honor of being sacrificed, come to mind.
And as I write this, I suddenly find myself thinking of Indiana Jones and the Temple of Doom, with Willie dressed in a sexy, gratuitously jeweled outfit, and pampered with luxury -- right before she finds out she's to be the human sacrifice.