When the male protagonist lays out the murder details of his own design to Shi Wang, it is a live demonstration - this is the key. In the film, the first thing the male protagonist does when he goes home to deal with the scene is to "search the corpse to find the key", which shows that he knows the importance of "retrieving the key". Then, a person who is standing by the door of his house and laying out the details, when he demonstrates to "take the key to open the door", his experience and instinct will tell him to tell Shi Wang to "open the door and put the key back under the stairs".
However, we saw that the male protagonist, like a nerd imagining out of thin air, told Shi Wang, "Remember to put the key back when you are done": this is obviously counterintuitive.
Hitchcock asked the male protagonist and Shi Wang to repeatedly emphasize "put the key after you are done" in their lines, just to lure the audience. I mean, Hitchcock himself knew the absurdity of this passage, so he was using his rich film experience to induce the audience to forget common sense.
View more about Dial M for Murder reviews