A transmitter’s generation is not defined from only one angle. Critics may classify by age, status as Companion or Successor, or which generation of teachers the person actually encountered. The same person can accordingly be situated differently under different classification schemes.
Anas ibn Mālik, for example, remains a Companion by virtue of his meeting the Prophet ﷺ as a believer, although he was young compared with many other Companions and lived for many years afterward. His relative youth does not change his status.
Practical conclusion: two different numerical generation labels are not automatically contradictory; investigate the organizing criterion first.