Under gassed, would cause short stroking of the bolt/carrier which could keep it from travelling fully rearward and ejecting the round before being driven back forward by the recoil spring. this can be caused by the gas tube being obstructed, which usually doesn't last long because the gas pressure usually clears it. It can also be cause by teh gas port not being drilled properly or the gas block not being aligned properly over the gas port in the barrel. IF you have a bolt on gas block/front sight base, this could be the culprit. Also the gas tube has a retaining pin that runs through the gas block to keep it lined up and in place. This pin can walk out and make your gas tube free float and cut off gas.
Moving rearward in your gas sytem you can check the gas key on top of your bolt carrier and ensure that it is fully seated on the carrier and that the retaining bolts are fully tightened down and have staking marks that keep them from backing out. If you see signs of carbon leaking out from under this gas key, then your problem amy lie right there.
Also check teh gas rings on teh tail of the bolt. There should be three of them. When the bolt is put in the carrier and the cam pin is in place the bolt should be able to be pulled forward and then the whold bolt and carrier assembly should be able to be set down on a table on th ebolt face, and the tension from the rings should keep it from sliding freely back into the carrier with just the carriers weight on it. If it fails this test, replace the gas rings
If all of this checks out, then it is probably not gas related, unless your ammo is too weak. (One other gas possiblility that I will mention later, but not a weak gas problem).
Next thing that would keep the bolt from travelling fully rearward is in the buffer/tube assembly.
Make sure there are no obstructions in the buffer tube that would prevent full travel of the buffer/ carrier/ spring. Make sure you have the proper length recoil spring and right buffer. Carbine buffer tubes require a shorter but heavier spring, and a short buffer. Having a rifle length buffer or rifle length spring in a carbine length buffer tube will prevent the carrier from traveling rearward fully.
Some folks will add a rubber recoil buffer to prevent jarring of the action. These are not needed, and the buffer on the AR already has a rubber plug on the end of the buffer. Also make sure that that plug has not come loose and dumped your internal weights from inside the buffer.
Next problem can be from "bolt bounce" This can result from being "overgassed". AR carbines run a shorter gas tube and have the gas port located closer to the chamber than rifle or midlength gas systems. This means that gas is bled off at higher pressure and for a longer period of time than in the longer gas systems. This can mean that you get a more violent rearward puch to your bolt carrier group and it can be traveling rearward so fast that it is hitting the rear of the buffer tube and gets bounced back forward before the ejector spring can puch the shell off the bolt face and out the ejection port. This usually also means that the ejector spring is too weak as well. This can be compensated for by getting a heavier buffer (H, H2, or 9mm carbine buffer). This increases inertia of the bolt carrier and makes extraction occur a bit later so that gas pressure has dropped a bit more. Rearward travel is also slowed down giving more time for ejection to occur.
Just a few things to check out.