I see, that does trigger my memory though, and I found this thread of an error that was triggered by the Cardgate plugn: https://www.ads-software.com/support/topic/plugin-conflict-166/
As you can see I already mentioned in that thread:
You may want to test whether invoice attachments still work for orders placed with that gateway.
Apparently the Cardgate plugin triggers emails earlier than normal (other gateways), when the PDF documents are not defined yet. Could you try placing an order with another gateway or temporarily deactivate the Cardgate plugin to see if that resolves the issue. That at least narrows it down so we can see if there’s something we can do about this.
Let us know what you find!
Ewout