When you pick up a turret or craft ammo, it automatically goes into the bandoleer, but because of how the bandoleer works, the ammo ends up in the slot where your weapon should be, but since you have it in your hands, these cells are empty.
And when switching to another weapon, everything eventually breaks until you manually make sure that the ammo and weapon match each other correctly.
This can be fixed in several ways:
prohibit automatic ammo from going into the bandoleer;
block the slots while there is no weapon there because they are in your hands;
Add a button similar in functionality to the Quick Wagon Filter by Sytha. So that you can quickly set up filters.
Okay, I checked and the only way for everything to work now is to block the cells for the current weapon and ammo for it with a filter.