That's just how the game works though- it would be so much trouble to program what does and does not define as a "house". You could place a piece of wood over their heads and the AI could break and think it's inside a house. If you simply mean when they're not exposed to sunlight, which is a real feature that the game can detect, they could just be under a tree or an overhanging roof/mountain.
They already require open beds and many village homes only have one bed, so even if the other villager returned to their home afterwards, the villager that went to the other's house would have no incentive to be there and the child would "weirdly" have to find an unused bed in an empty home anyways. Basically, the villager's AI doesn't specifically choose another villager to breed with. They automatically go the closest other villager who isn't on cooldown to breed, so not only would they have to reprogram how they detect breeding specifications and what a house is, they would also have to reprogram how the food sharing system works. If they shared food with a villager on the far left side of the village and lived on the right, they would be closer to a different villager on the right side.