Currently, the Encrypt key is only read for the document trailer.
However, when mutliple trailers are present, the code for reading all indirect objects in ReadAllIndirectObjects can lead to calling IsSecurityHandler method, that can iterate over SecurityHandlers for all previous trailers.
The lazy initialization code will access the Encrypt key under the asumption that it has been read already, leading to an exception.
Unfortunately, I cannot share the file leading to this discovery, sorry for this.
Currently, the Encrypt key is only read for the document trailer. However, when mutliple trailers are present, the code for reading all indirect objects in ReadAllIndirectObjects can lead to calling IsSecurityHandler method, that can iterate over SecurityHandlers for all previous trailers. The lazy initialization code will access the Encrypt key under the asumption that it has been read already, leading to an exception.
Unfortunately, I cannot share the file leading to this discovery, sorry for this.