- Make 100 science packs or ammo mags, and a container.
- Use one of the science packs or ammo mags until it's at 10% durability.
- Place the 99.1 science packs / ammo plus a container into a containerization machine to get a container of 100x the item.
- Unpack it to produce 100 items with full durability plus the container.
Not sure how hard this would be to automate, would probably need a timer or something because I don't think you can read an item's remaining durability with circuit network.
I don't think there's any way to fix this, except forbidding packing for ammo and tools entirely, which IMO isn't worth it.
The base game also has something like this - you can use a yellow mag to 10% durability, then turn it into a red mag, then use that to 10% durability, then turn it into a uranium mag. But it's not cyclic like container packing/unpacking so it doesn't allow infinite free stuff.