- Picard grew more comfortable with children over the course of the series
Much like Data started the series with almost no understanding of human behavior but evolves over seven seasons, Picard begins unable to deal with children effectively but learns as the episodes pass by. The most obvious relationship is the one with Wesley, whom he initially wants off the bridge, later dismisses with the infamous "Shut up, Wesley!" line, and finally relates a personal story of not passing his exams on the first try. Also consider how well he leads the children in Disaster and the establishment of Captian Picard Day. Many other characters have similar arcs; Worf begins growling and pointing his phaser at everything (even the viewscreen) but learns restraint; Riker starts off as a hardass but loosens up when he grows the beard; Geordi has problems talking to women that he later overcomes.
- His nephew was very special to him
Despite having either never met him or not having seen him since infancy, Picard was well informed about his nephew through letters, which he comments in this episode "made him feel like part of the family." We also learn in Generations that Picard also looked to the boy to be (pardon the pun) the next generation of the Picard line. Picard felt he didn't need to have a son of his own because his brother had already, so in at least some since he viewed his nephew as a surrogate son.
- For Picard, connecting with his family is both abnormal and therapeutic
As you mention, Family is the episode immediately following The Best of Both Worlds, in which Picard is assimilated by the Borg and helps them kill many in the Federation. This episode is about healing. But the thing about Picard is that his normal state is, if not withdrawn, very private. His leadership style is very much about projecting a certain image of the captain to inspire people to follow him with confidence (as Dr. Crusher learns in Attached). So for him, the Borg experience was one that was finally traumatic enough that he can't quite handle on his own, so his healing process is to reach out to his family. His need to connect with them is greater than any lingering discomfort with children at this time.