Strangely, stuffing the hole with mud didn't set up the trap.
(I bet you want to take the key now, so...)
The exact moment one of you steps before the niche to take the key, a spray of mud ejects from the hole - it seems that the improvised barrier worked! A few seconds later, a spring rises oneedge of the tile which was apparently under the mud before the niche, which'd make the person standing there fall - if it was still standing there.
The key fits the lock. The door is now open.