@vascorsd I had something similar to that happen to me recently as well. I'm using a #prosody server, and I have my:
archive_expires_after = "5w"
... set in /etc/prosody/prosody.cfg.lua
Messages should be archived for 5 weeks.
Then messages sent in Gajim on one linux laptop were lost, when a second #Linux laptop who was subscribed to the same group, was turned off (absent from receiving messages) for 3 weeks. 2.75 of the 3 weeks worth of the group messages (where the laptop was turned off) silently never showed up, when #Gajim was re-opened on the second laptop.
This bodes very badly for me recommending XMPP to others. I now consider #DeltaChat to be a secondary choice, should something happen to #Signal (which is currently my privacy-respecting Messaging app goto).
Other clients who chatted in that same group, BTW: the latest stable #Monal in #iPadOS, and #Conversations in #Android
Prosody version is 13.0.0-1~bpo12+1, backend is sqlite, Gajim is 2.1.1. It was a private MUC, and OMEMO was used as much as possible.