Hmm so a weird thing happened.
I displayed the number of keys as you suggested. All was working fine.
I approached the 3rd locked door without a key (display said zero keys) and I still had the same problem.
I restarted the game and did it again. Then, it was locked, like it should be. But then I approached it from the side and it opened. So I went back and fiddled around with the first locked door. It's doesn't "open" (the tile doesn't disappear) but I can glitch through it without a key.
I wonder if there is something weird about having a warp tile right on top of a locked tile? Or maybe something with the collision where, given the size of my character, there is some collision with the corner of the warp tile? I dunno. I'm gonna do some digging though, and worst case scenario just redesign the rooms a bit to see if I can keep it from happening