What does it do with no magazine in the rifle?
Same problem, or no problem? If the problem occurs with no magazine inserted, then the first thing I'd suspect would be the buffer spring, and then I'd check to see that the correct buffer is installed. Then I'd inspect the bolt and carrier for anything unusual, especially checking for wear marks in odd places. Then I'd inspect the interior of the upper receiver and in the barrel locking lugs. It could even be a matter of fouling building up in the lugs.
If it only hangs up when a magazine is inserted, that points to a magazine catch problem or a defective magazine.
Once in a blue moon, you'll encounter a lower receiver where the mag catch slot is milled too high in the receiver, which can cause some mags to cause problems, yet they'll work perfectly in other rifles. I've only seen that problem once, but it's worth checking if the problem isn't found by other means.
CJ