when I was 6 years old, in first grade, I had a severe crush on a girl in my class; her name was Carol D.
I had no idea why I felt so attracted to this girl but the attraction was overwhelming.
I did one of the corniest things ever; I went to the grocery store with my Mom, as I always did, went to one of those vending machines that contains the two-piece containers that contain weird little items, I got one that contained a ring, and I gave Carol the ring one day at school the next week. This, at six years old.
I have no doubt the nine year old kid from the OP article believed he was gay. I'm not saying he was gay but I believe the kid thought he was.
Kids are MUCH more intuitive than most adults will ever give them credit for.