The way I see it, just because you learn something one year doesn't mean you can't wait a few months before you write it down. It could have been in his 5th year potions book too, we've neevr seen that. Maybe he re-copied a few old notes into his new book.
Either way JKR's not perfect, no one is. But if little plot glitches bother you that badly, it's easy to make up a possibility for their existence.