RE: AR-15 ? Bolt won't stay open after last RND
Magazine would be the first thing to check as its the most likely.
If not:
Check your bolt release for damage/wear.
What ammunition are you using? Are you having any problems with the action shortstroking? Have you tried different ammo?
Was the upper assembled at a factory?