I had the same problem a couple of months ago. I tried many different magazines , some would hold the bolt back others wouldn't.
All magazines were 20 rounders VietNam vintage. The mags that wouldn't hold the bolt back had new springs added. But one must realize that you could be in a situation where you don't have your personal mags with you and besides it gets expensive to replace all those mag springs, and besides it's a PIA.
I have several AR's and all the mags used in these rifles prior to the magazine spring replacements did hold the bolt back on the last shot. I investgated further to find that the rifle used where the bolt would not stay to the rear had a rather strong bolt catch spring, one could tell the difference between this bolt catch comparred to the rifles that didn't have that problem. I ordered a new spring from a different source and replaced the old one, problem solved. Every mag I've used locked the bolt to the rear on the last shot.
BTW, I did have proper recoil spring and buffer, the problem was a too strong bolt catch spring that prevented the magazine follower from activating the bolt catch.