A nasty inventory problem has existed for a long time now, and it seems nobody so far has bothered to reproduce it. Basically what happens is, that sometimes when you are swapping your gun from your hands to your backpack, it actually drops the old gun to ground and deletes all the magazines from your inventory. The magazines are completely gone, they are not in ground with the old gun, they just disappear.
This only happens if you don’t have room in your backpack for the gun. However back in the day when it still used to work, you could just swap the guns without problem as long as there was room in the backpack for the 1st gun after the 2nd gun was removed.
Also apparently for the bug to trigger, you must have swapped a bigger backpack to a smaller capacity one, though it might be that different capacity clothes/vests also affect this.
This happens ONLY on multiplayer server. If you test locally in the Editor it sort of works. However, there might be another hint to the behavior that does happen in the editor as well. If there isn’t space for the 1st gun in the backpack, it drops the gun to ground and moves all your magazines for the dropped gun from your clothes and vests to your backpack, even if there isn’t capacity left in the backpack, it basically overloads it.