The bug
When you update the nbt data of the lectern with:
{Lock:"lock"}
You can still open the block as normal without needing an item renamed to lock.
How to reproduce:
1. Place down a lectern
2. Run /data merge block <coords> {Lock:"lock"} at the location of the lectern
The lectern is not locked and I can read what is inside.
Lecterns aren't meant for storing items, so what is the point of being able to lock one?