There are some simple diagnostic steps you can take to tell you where the problem is.
Swing the cylinder open. With a punch or small screwdriver, push on the spring-loaded pin that extends from the locking lug under the barrel. If that moves in easily against spring tension, your problem is somewhere else.
Push on the end of the center pin that protrudes from the ejector star on the rear of the cylinder. If you feel drag or resistance, or if the pin seems to move forward a little, hang up, and then suddenly release under continued pressure, your problem is in the way the center pin slides through the cylinder and the ejector rod.
If there is no problem with the center pin, move the thumb release back against its own spring and release it. Move it back and forth and see if there is a position in which it seems to lock or hang up.
My guess is that the problem is going to be gum and grime in the center pin channel, or even a mushroomed tip at the front end of the center pin. Disassemble the cylinder assembly completely, clean everything out, relube, and reassemble. If the end of the center pin is a little peened over, you can smooth it out with a stone.
I buy mostly older guns, and it seems to me that about one out of three needs the cylinder disassembly treatment. They all work more smoothly when they get it.
I do have one gun (a K-38 from 1950) with a sticky bolt, so the center pin is not to blame on this one. I think the solution there is going to involve replacing the bolt. I can't smooth the bolt or its travel channel well enough to make it work the way it should.