Can't open decrypted/passworded LO 6 Write documents

I have generated a GPG key according to the instructions at How to digitally sign a LibreOffice 6 document with GnuPG - TechRepublic and saved a LO6 write document encrypted and with a password. However, I can’t open the document anymore, even though the password is correct. I’ve repeated the procedure several times and in all cases the password I enter when I save the document is not being accepted when I try to reopen it immediately. LO Calc and other documents (not just Write documents) have the same problem. However, the problem does not occur when I don’t check the encryption checkbox and just save the document with a password, so it appears to be related to the encryption.

Am I overlooking something?