You wrote:
“Since people had strong doubts that there would be a next generation, record-keeping was not a high priority.”
And yet we have more than enough records to show that Leo IV was pope when supposedly Pope Joan was reigning. They records were in Rome, Frankish Gaul, Constantinople and numerous other places.
Since the Papacy was the center of Western Christendom at the time, one of the few things known with certainty from that period was who was the Pope, when he entered office and when he died.