The event of chapter 6 took place a good while after the events of chapter 5. The opening verse says ‘After these things’, but it is obvious as you read the Gospel of John that this phrase does not mean immediately after these things, but subsequently at some point of time.