When a key is stuck in a pin-tumbler lock, what that usually means is that one of the pins has dropped down into the key's cuts but isn't lifting back out of the way so the key can be withdrawn.
There are several possible causes. One is that the key was cut badly and doesn't have enough of a slope to lift the pin as it is pulled back. Uncommon, though sometimes done deliberately to trap a key in the lock so it can be used as a semi-permanent thumb turn.
But usually the problem is that the plug (the rotating part of the lock) is not properly lined up with the shell. For the bottom pins to lift, they need to be aligned with the chambers in the shell that hold the top pins. If the key is slightly rotated, that alignment doesn't occur and you can't remove the key...
... But the more likely malfunction scenario involves front-to-back misalignment. If the hardware holding the plug in the shell (usually the tailpiece screw or screws) becomes loose, the plug can slide toward you as you start to pull the key out, misaligning it and trapping the key. (This doesn't become a problem while inserting the key because there's a hard stop in that direction.)
I'm betting on that being the cause here. If so, pressing the plug inward with one hand while removing the key with the other will probably work, for the same reason that inserting the key worked; you'll be using the plug's shoulder as an alignment reference point.
Try it.
If that does the trick, your lock needs to be dismounted and the tailpiece screws (or equivalent) need to be tightened. Don't delay too long on that, or you may be facing more serious malfunctions.
If this doesn't solve it, we need more detail about exactly what you did and the current state of the lock. It may be necessary to disassemble things to resolve this. Which is sometimes challenging if you can't use the proper key.
(Courtesy of ORK Security Services -- full-service, very part-time, locksmithing)
Best Answer
In security the principle of weakest link applies. It's not possible to tell if the surface mounting alone will be the point of failure in your setup. The material of the door, the frame, hinges and the part which is most often overlooked: how well is the frame mounted to the wall pay equal role in providing security.
There is nothing inherently wrong in surface mounted lock - if the door is tough enough to withstand the localized stress. But if the door is weak, installing the full-width bar serves little purpose as well - it would be enough to break half of the door and crawl under the reinforcement.
I don't know what type of lock are you used to. If you're comparing surface-mounted lock with a one mounted inside the door (like knob tongue), then surface is massively more secure. Mounting a lock on the inside means removing portion of the door in the place where breaching force will be applied, while surface mounted one has full thickness to hold on to. Same goes with catch. Here where I live (Poland), surface mounted locks became dominant about 20 years ago for this very reason. Also keep in mind that adding more locks means drilling more holes, so at some point extra locks actually make the door weaker instead of stronger. If you have door with integrated locking mechanism, consider changing one of existing locks to an electronic one rather than adding extra.
You should not be concerned about regular opening and closing, pulling the locked door, etc. Properly tightened screws will not spontaneously loosen themselves. Using a proper threadlocker can also help (if and only if lock and door manual allows using threadlocker.) Which leads us to the most important part: manuals. Types of locks allowed for the door and types of doors allowed for the lock should be all explained there.