Here are real life examples:
* In decades gone by, certain countries (Ireland, France, Australia…) used to run "industrial schools" or "reform schools" where they sent "wayward girls". Since "wayward" girls were suspected of being immoral (read here: were having sex before marriage), they were often subjected to forced gynecological examinations whose goal was to determine their virginity, and humiliate them to be more pliable in the institution. Probably the official goal was to diagnosed STIs.
I've seen a photo of an examination room of such as school in Australia, complete with stirrups and speculum. In France, I've read testimonies of former inmates.
* An acquaintance of mine was suspected of having sex by her mother. Her mother wanted her to get on the Pill and dragged her to a gynecologist. The gyn wanted to do a pelvic exam, the girl protested, the mother said to disregard protests and she's just fussing for nothing. The girl endured a speculum exam, which she considers as "rape by speculum".
I realize this was probably against medical ethics, but this was 30 years ago and back then ethics were not so strongly enforced. Also, this could easily be disguised as "girl was having sex, responsible mother wants a STI diagnosis and contraceptives".
* A little while ago planes were soon to depart from an airport in one of these countries in the Arabic peninsula, I don't recall which one. A dead newborn was found in the toilets. They took women that were soon to depart to a medical facility and forced them to undergo a gynecological examination to see which one could have been the mother.