According to Sirius and Remus, James wasn't a prefect, but in PS/SS Hagrid said that James was Head Boy and Lily was Head Girl. So either
- James was a Head Boy without being a prefect (unlikely)
- Hagrid was exaggerating to build up J&L in Harry's eyes
- Harry misunderstood S&R.