Hi, thanks for your reply!
For your information, I've been using Pokegen to make the first three starter Pokemon and those from Route 1 and had yet to encounter this problem. It was until I reached Poke Center in Nacrene City when I was about to make Gigalith, Roggenrola, Boldore, Woobat, Swoobat, Blitzle, Zebstrika, Pidove, Tranquill, and Unfezant that the problem surfaced. And these are the code generated by Pokegen, please have a look.
Thank you.