I am usually pretty careful about not selecting "try for baby" when prompted outside of the playable sim's household. As you mention, it usually is between sims who are connected romantically from the same household. I've never gotten that prompt for a sim with a random NPC. I've used that prompt before, but the baby always happens between the sims who live in the same household and have a romantic connection. There is a chance that I accidentally selected for them to go on a date (as I usually just randomly select an option for the hang out/date prompts), however, my playable sim is married and I don't ever recall getting a prompt for married sims to go on dates with other sims. I've also noticed that when I select the 'go on a date' prompt, that the NPC will appear in the relationship panel when I play that sim again. This NPC is nowhere in the relationship panel, so I don't think this is the case.
I've attached a screenshot of the genealogy panel. The baby that came about is highlighted (and is part of the NPC household). The family on the right are NPCs and the family on the left are my playable sims.
I do have this glitch: https://answers.ea.com/t5/Bug-Reports/Innocent-spouse-accused-of-cheating-because-NPC-is-flirty/m-p/10194585#M178145
Because of this glitch, I have some neighbourhoods with public lots set to 'free love' so that I don't have to deal with the 'cheating spouse' caused by this bug. Could both of the sims have been on a public lot while I was playing a different household and started an invisible romantic relationship because of this bug?
I have several households in my save right now, so I'll keep an eye out to see if it happens again and will try your suggestion to enable/disable the stories.