When unloading 5.56mm ammunition from a magazine larger than 30, the stack size matches the magazine, not the maximum stack size for the ammo itself.
For example, unloading a 10-round CMAG results in 10 stacked ammunition. Unloading a 60-round magazine results in 60 stacked ammunition. The inventory only allows 5.56mm to be stacked 30-high.