The channel's in-memory message queue is a temporary cache that holds onto messages for up to 5 minutes and is limited to 100 messages (the most recent 100 messages). But if messages are published at a fast rate, then messages can be pushed off the queue and not be available prior to 5 minutes period.

For long term, reliable persistence and retrieval of missed message, you should enable Storage add-on with a duration of 1 to 30 days or Unlimited and use the history API to retrieve those messages.