The most likely cause of the key turning but won’t come out I one position is that the lock is not turning a full 90 or 180 degrees depending on the lock. In this situation, it is likely that the cam is rubbing or hitting something that is preventing the lock from turning it’s full turn. Check behind the lock to see it is hitting something. If you don’t see anything, remove, the small nut, lock tab, cam and stop and turn the lock to assure it is turning all the way and the key will come out in both positions.
The other cause that the lock won’t come out in a second position is that the stop is installed wrong. The lock shell is made so that the key will come out in three positions. If you remove the lock from the shell, you will notice that there are three grooves inside the shell, the key can be removed when the lock sidebar is in any of those three grooves. If the stop is turning the lock to a fourth position, where there is no groove, the key will not come out, simply flip the stop over so that the lock, cam and key turn the directions you want.