Ok, found a way to reproduce (RIP my USG45). Go to a tight space where you don't have room to perform the animation of changing the magazine. I tested this tucked in a corner on second story of a house, first I was facing towards the center of the room and dropping the magazine by dragging it to vicinity worked normally.
Then I turned a bit to face furniture (so I would not be able to eg. raise the gun in that position) and tried to drop the magazine from the gun which resulted in no change on the inventory side (still present in the gun's magazine slot, no magazine in vicinity), but the gun visibly does no longer have the magazine and thus it cannot be taken out or swapped.