In this demo Alice is using Bob's public key to sign a message that only the Bob can decrypt. Is it safe for Bob to reveal this decrypted message, or would that allow an attacker to determine his private key?
After remembering the key phrase "known-plaintext" the answer became obvious. The question should be: Is Public Key Encryption vulnerable to known-plaintext attacks. To which the answer is: no, not for modern algorithms.
The specific example I posted is using ECIES (AES-256-CBC), which is resistant to known-plaintext attacks.
Thinking about it another way - the whole purpose of Public Key Encryption is that anyone can encrypt a message that only someone else can read (the holder of the private key). If it were possible for someone to make messages with the public key and derive the private key then the algorithm would be useless.
The main "risk" is that there is no forward secrecy, which means all past messages could be decrypted if the key were compromised. However, in blockchain there are much bigger issues than revealing past messages if the private keys are compromised.
The scenario I had in mind is waiting to reveal the message in a commit-reveal scheme, which makes this risk this is a non-issue.