I'm far from a AR 15 expert, but at first blush it sounds like the bolt may not be going far enough back for the disconnector to catch the hammer. A few reasons for this, buffer spring too stiff (old sticky oil, trash or whatever), which is unlikely as they don't usually get stiffer with use. Might be a partial blockage of the gas tube. I had one that did what you describe, kind of. I eventually found a tiny piece of cleaning patch jammed in the barrel end of the gas tube. Anything from dirt or sticky oil on the bolt to a dirty chamber can slow the bolt, you may be in the sweet spot where the bolt is slowed just enough to not engage the disconnector and hammer hook (catch) but far enough to successfully eject the spent case.
Maybe your disconnector or hammer hooks aren't catching for some reason. Pretty easy to imprint the hooks, a very little yellow crayon (or lipstick) on one of the hooks then work the bolt and the trigger a few times and see how the dye smears, may take a few tries to get a good smear. You can see if they hook deep enough or hook all the way across the face of the hooks, in other words have a good fit. The disconnector and trigger hooks you can feel with your finger tip, maybe someone overdressed them for trigger smoothness pull and they aren't catching sometimes or one or the other of the hooks is rounded somehow.
When you said you have to partially pull the charging handle back and/or slap the side of the rifle to get the disconnector to catch kind of threw me. The disconnector isn't going to catch with a partial charge pull on the handle. Weak disconnector spring, the hammer really stiff on the pin (axis). and/or the disconnector really sticky rotating on the pin (axis).
My names for some of these items may be off, doing it and talking about it are two different things. Sounds complected it really isn't, not all that any parts in an AR 15.
Everybody has their own magic firearm lube. Mine are bore cleaner, liquid wrench 2 and Ether for cleaning and Break Free for lubrication, Old oil gets sticky and stiff either from the heat or age. It can get jelly like or even stiffer.