The implication seems to be that not knowing about magic isn't enough, you have to be ***consciously*** repressing your magic, forcing it back inside until it finally erupts. 

> *‘It’s a manifestation of Dark magic,’ explains Yates. ‘It’s really a
> wonderful idea that Jo came up with. **When a young child is prohibited
> from developing their magic in a healthy, organic way, then this dark
> energy can develop,** and the dark energy can suddenly get out of
> control and wreak havoc.’*

> <sub><sup>[Inside the Magic: The Making of Fantastic Beasts][1]</sub></sup>

Harry, by comparison isn't especially *trying not to do magic*, although in later years, had he remained with a vehemently anti-magical family like the Dursleys (rather than going to Hogwarts), there's a distinct possibility that he could have gone on to become an Obscurial.


  [1]: https://www.harpercollins.com/9780062571328/inside-the-magic-the-making-of-fantastic-beasts-and-where-to-find-them