It might have started out being a coincidence, since Fantastic Beasts wasn't yet planned, but I think one could argue that even something like these Harry Potter lines of dialog are being made to at least be a thematic link to Fantastic Beasts in tying both series more tightly together as companion pieces.
Some examples of connectivity:
Hagrid, like Newt, loves magical creatures to a fault (Spider debacle = "You never met a monster that you couldn't love") and Luna Lovegood, Newt's blood relative who, also like Newt, sees the good in things and notices things other do not, tends to be Harry Potter's animal/creature caretakers or introspective creature characters.There is also perhaps Sirius Black's running around as "Padfoot" and his friendship with Professor Lupin a werewolf, Professor Sprout, like Newt, A Huffelpuff (Mandrakes = Bowtruckles), Bill Weasley (raises dragons for a living), or Voldermort's fondness of Nagani...
What's curious about this is that the second film, 'The Crimes of Grindelwald' seems to be making much more effort to tie things together.
We already know the Elder Wand, one component of The Deathly Hallows, appears at the end of Fantastic Beasts, but from the three Crimes of Grindelwald trailers,
we also now know that Nicolas Flamel and The Philosopher's Stone are
featured, along with a younger Dumbledore, Nagani, flashbacks to
Newt's time at Hogwarts, and a lake/underwater sequence similar to
those during The Triwizard Tournament Lake scenes in The Goblet of
Fire. Paris is also one location and the Triward tournament included
characters from an all girls French Magical school. Harry saves one of >! the girls, Bill >!Weasley marries her older sister, Fluer.
At the end of the day Fantastic Beasts is thematic to the idea of exploring literal magical creatures/beasts, to those that are repressed or cursed into magical creatures/beasts, transfiguration, and/or more importantly, the figurative 'beasts' that can live inside any person, which is relative to characters relationships and/or one's fondness of another, despite that at some point, some will be overcome with darkness and others will be forced to fight those they thought they cared for, causing a struggle from within (ie "the heart"). This relates to both series, even though Fantastic Beasts is exploring the idea much deeper.
Like Jon wrote in the comments, I think this is definitely an "easter egg" and easter eggs do serve as reference to link and create theme.