JK is a witch, her pen is her wand. Most of what she casts is pure literary magic! I love the majority of her stories, though the HP Universe is by far my favorite of her works to date.
My best bet is, that in your mind, HP is married to Neville Longbottom that inadvertently changed his gender to female after a potions accident, fell madly in love with Harry after feeding him an unrequited love potion, had sex with him, not quite understanding the female form and got pregnant by accident rather than by choice after divorcing female Blaise Zabini. That enough imagination for you?