For me, if I remove a magazine from the gun while the gun is equipped to my back, the gun than becomes bugged out. Same happens if I try to load the mag into the gun while it's equipped to my back. Steps would be as followed:
1. Equip a rifle to your character's back.
2. Hold A on the magazine while the gun is still equipped, and move it to a different inventory/vicinity.
3. Attempt loading the new mag into the gun any way you can.
4. If you manage to load a new mag chances are it either won't fire or it will fire ghost bullets.
There is another way I just remembered, if you have a gun sitting in your inventory somewhere (not equipped) and you have no room to store a spare mag but you push Y on the mag to move it to your inventory anyway, it will equip itself to the weapon and when you pull the gun out it will be bugged and that mag stuck inside of it.
1. Have an unloaded weapon in your inventory and no spare room left in inventory.
2. Try storing a mag into your inventory while the gun is in there, again, make sure there is NOT enough room for it to be stored. Also make sure there is NOT a mag already in the weapon.
3. If there is no room to store the mag but it disappears from your hand or vicinity after pressing Y on it, chances are it equipped itself to the gun.
4. Pull the gun out into your hands and check it. Look for a mag/see if it fires/try reloading a new mag/etc...
I hope this was helpful, absolutely addicted to this game rn lol.
Love you :3