I had a similar issue. Inside the socket, there is a plate with two contacts that match the contacts on the base of the bulb. A spring pushes the plate contacts against the bulb contacts. I found that while pushing the bulb in and twisting, the contacts on the bulb would catch the contacts on the plate, rotating it slightly so it would not make proper contact with the bulb. I smoothed off the contacts on the bulb so it would glide over the contacts on the plate; don't know if that helped. But after a few tries, it worked OK.
Since then, I have bought LED tail light bulbs and they were installed without issue. Maybe the contacts on the LED bulbs were smoother.