The Disappearance, a 1951 novel by Philip Wylie. Wikipedia synopsis:
The Disappearance (1951) – An unexplained cosmic "blink" splits humanity along gender lines into two divergent timelines: from the men's perspective, all the women disappear and from the women's, all men vanish. The novel explores issues of gender role and sexual identity. It depicts an empowered condition for liberated women and a dystopia of an all male world. Wylie's setting allows him to investigate the role of homosexuality in situations where no gender alternative exists.
So, the premise of this story is that (on our world) a husband wakes up in his bed one morning to find the fetus of his unborn baby son next to him on the bed.
Logically that must have happened many times, but I can't find a scene like that in the book. However, there is a parallel scene in the women's world:
The civilized earth became a shambles of wrecked motor vehicles.
Trains ran on, in many cases, their locomotives unsupplied with "dead man's" brakes.
Thus the Golden Comet, luxury express, having made its appointed stop at Palm Beach, rushed toward Miami an hour behind schedule. Of a sudden, there were no men aboard it and no little boys playing tiredly in its handsome aisles. There was, even, another sort of palpable loss on the train, as everywhere.
Genevieve McCracken, in the observation car, hurrying home to bear her third child, suddenly found the mound of her abdomen relaxed, caved in, all evidence of pregnancy vanished. She hastily rose, clutching her slipping skirt. In her compartment she disrobed and stared with horror at the slack folds of skin that only minutes before had harbored a viable child, a son, she had hoped. She pressed and kneaded herself with a quivering hand. But the fact could not be denied: her child was gone, and she had not borne it.
The novel (or at least novella length story) follows the progress of the world as it tries to get a handle on things;
Alternate sections of the novel tell the stories of the world of men without women and the world of women without men.
here are several nuclear wars, etc.
Three days had passed since the "declaration" made by the Soviet government and the beginning of atomic war. In those three days seventeen Russian cities, including Moscow and Leningrad, had been attacked and either partly destroyed or wholly obliterated. Eight manufacturing centers behind the Ural Mountains had been wrecked and left radioactive.
[. . . .]
Oakland and Berkeley had disappeared in the whelming holocaust that had wrapped San Francisco Bay in atomic fire. Chicago was gone, as was San Francisco. The radius of severe devastation at Chicago extended beyond Gary, Indiana, on the east, Joliet on the south, and Aurora to the west. This was the flash that Gaunt had seen in the predawn hours of the sixteenth.
Eventually contact is made with the parallel Earth women were sent to.
The men and women are reunited, as the world is reset to the instant of the "disappearance":
Gaunt snapped his fingers: the light lost its blue luminosity. The vast dimensions contracted. He and the boy were no longer dots in a matchstick sailboat on a pale and vacant sea. His eyes took an instant to reaccommodate. [. . .] There, in front of him, was his typewriter and part of a page on which he had evidently been writing. [. . .] He shut his eyes, for an instant utterly appalled; his ears took up the shocked function. A woman was singing. A woman. High notes trilled; it was the "Italian Street Song": Edwinna.