When you create the scoreboard that checks if you have opened the chest and it's locked, when you try to open it without a key, the scoreboard still counts it as opening a chest.
Environment
Windows 10 64-bit, Java 1.8.0_281 64 bits, 1920 × 1080 60 Hz, Intel Core i7 @ 3.9GHz, 8GB RAM
Thank you for your report!
We're actually already tracking this issue in MC-75532, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote or any additional information to the main ticket it would be appreciated.
Please be sure to use the search feature before creating a ticket to see if the issue has already been reported.
Quick Links:
📓 Bug Tracker Guidelines – 🛠 Community Support – 📧 Mojang Support – ✍️ Feedback and Suggestions – 💬 Mojira Discord