A little more info would help. Some of my guns will do that if I have been shooting a while and the gun is getting dirty.
If the gun is doing this from the get go, something is wrong.
From your letter, it indicates the gun runs fine up to a point. We need to know what that point is.
Can you elaborate a little?