The issue seems to stem from SpamAssassin. I was using Rspamd, and in some domains, SpamAssassin was active. When I disabled it, the problem was resolved. I'm writing this to provide information in case someone experiences a similar issue and there is no answer to the question.