I can add some more information how this works. Messages from device to gateway are acknowledge and retried if the acknowledgement does not arrive. The gateway buffers that information and publishes that message based on the QoS. That works ok in most cases but some things still can go wrong.
- When messages send by the module are not acknowledged after 5 retries by the gateway, the message is removed from the queue.
- When the gateway is very busy and runs out of memory space that it has to throw out messages.
It looks to me that the first problem is happening.