When did our ancestors switch to a menstrual cycle instead of the estrous cycle?
Menstruation occurs only in most of the primates, and a handful of other mammals. It is tempting to speculate that place the switch to menstrual cycles evolved right after the split between non-menstruating primates (tarsiers and their relatives) and menstruating relatives (almost all others), which is about 63 million years ago.

There are other menstruating animals, so I am not sure if nature reinvented menstruation whenever social conditions required unproductive sex, or menses are in fact a more archaic trait.

I doubt we have material evidence about all these speculations.