I have somewhat of an interest in sighting the new moon. I recently heard a lecture by someone who had written a program to provide the conditions for the first new moon sighting for any location for any given month. The time that the program uses as the basis for the sighting (not that the moon would necessarily be visible at that time, but the earliest time it potentially could be) was the first moonset following the new moon (of course if sighting were possible it would have to be a bit before the time of moonset).
The lecturer explained that sunset would theoretically have been the better time to use. However, he found that there were a few days in which despite the new moon having occurred, the moon sets before the sun. He gave November 13, 2023, as an example. (e.g. in London, England, the new moon occurs at 9:27, the moon sets at 15:56, and the sun sets at 16:12). From what I can tell, this will be the case in most locales in the Northern Hemisphere east of New York. The lecturer himself was a programmer, not an astronomer (he had just happened to stumble on this phenomenon while designing the program) so he was not able to provide much additional information.
I am interested in understanding a bit more about this phenomenon. What are the conditions causing it, and how often does it happen somewhere in the world? Thank you!