I don't know the novel you are discussing but I presume it is a historical novel written by an author who did some research. The notion of a rule against the execution of a virgin is clearly derived from an incident in the fall of Sejanus during the reign of Tiberius that is related by all three Roman historians whose accounts we have: Suetonius, Tacitus, and Cassius Dio (none of whom had been born at the time and all of whom claimed to be relying on earlier authors).
Suetonius, Tacitus, and Dio Cassius all portrayed Tiberius as a sexually-perverted tyrant. [EDIT: well, not so much Tacitus on the sexual perversion.] Sejanus had been the head of Tiberius' Praetorian Guard and thus kind of like his chief security official. Think "evil KGB head" but wearing sandals. Sejanus rapidly fell from power in 31 CE, apparently after Tiberius stopped trusting him or decided he was too unpopular to keep in the inner circle. Not only was Sejanus summarily executed but his immediate family including his apparently minor children were killed or committed suicide.
According to all three accounts, the executioner raped Sejanus' daughter Junilla before killing her because there was a rule against or a lack of precedent supporting the execution of a virgin. That is the sole reason given for the rape in the stories: we are not directly told that it was ordered by Tiberius or (unlike so many Roman stories) that the rapist was motivated by some kind of sexual lust or wish to degrade the victim. In Tacitus' heartrending account, the girl does not have any idea what is going on and protests that since she is a child she should just be beaten for whatever she did wrong. We don't quite know Junilla's age, but it appears she may have been betrothed to one of Tiberius' sons in 20 CE so that would make her 11 or more in 31 CE.
What was the reader to make of this? Remember the three authors were all quite negative about both Tiberius and Sejanus. So the story that there had been a longstanding rule against executing virgins which was brutally circumvented in the terror surrounding Sejanus' fall (possibly with Tiberius in the background) by raping the victim is probably meant to underscore that Tiberius was a really bad and perverted guy, that Sejanus was utterly hated, or both. An alternative reading is that there was no such rule but the executioner, motivated by the general atmosphere of perversity and hatred engendered by Tiberius' destruction of social norms (facilitated by Sejanus), made it up in order to justify his outrageous behavior.
There is no more detail on this alleged rule. As far as I know, it isn't attested except in connection with this incident, and there is no additional context in any source. There is no story of a girl or woman who would have been executed but was spared on account of her virginity nor is the horrifying loophole reported in other stories.
The Romans had some stories about noble women of their own past who killed themselves or were killed by family members because they had been or were about to be raped; e.g., Lucretia (suicide after revealing rape to family), Verginia (killed by father to avoid enslavement and rape). (It's notable both those incidents supposedly led to further violence and political revolution.) Also, the punishment for a Vestal Virgin who was sexually active was death, allegedly by being immured and starved since no one could lay violent hands on even an unfaithful Vestal. But these are not quite on point.
Likewise, the Roman persecution of Christians spawned a lot of hagiographic literature that gives a great deal of attention to the sexual status and victimization of female victims. But neither hagiography nor Roman official correspondence nor anything else reveals special concerns about executing virgins. Hagiography is replete with rapes and attempted rapes of Christian virgins but they are attributed to the lust of the pagan persecutors rather than some rule against executing virgins that can be circumvented via rape.
I believe it's the case that we can't confidently point to any instance of the official execution of a young girl in prior Roman history, so in that sense it may have been unprecedented. (Some teenage boys like Caesarion had been executed but they seem to have been considered adults.) But the idea that the daughters of out-of-favor Roman aristocrats had been spared execution solely because they were virgins is a strange piece of reasoning, almost as strange as the reasoning that raping them renders them suitable victims.
So that's almost certainly where your author is coming from: highly-prejudicial, written-after-the-fact accounts of a pretty jarring incident of Roman political violence say there was such a rule.