Locked room mysteries are basically a novel version of a puzzle. Much more exciting crossword, although there tends to be a higher bodycounts. So swings and roundabouts.
The beauty of a locked room novel is that you know there is a twist. The fun comes from trying to figure it all out with whatever character is doing the detecting. A really clever author can have you guessing, build up your confidence that you know what happened and then still give you a surprise at the end.
Apparently the first one was written by Edgar Allen Poe: 'The Murders in the Rue Morgue' in 1841. Although when you see a fact like that there are usually caveats about a Chinese or Indian author who did something basically the same 500 years earlier. So we will keep looking.