потому что ты делаешь всё немного не так
/item replace block -573 144 -901 container.0 from entity @s weapon.mainhand
/data modify block -573 144 -901 Items[0].tag.GunCurrentAmmoCount set value 0
/item replace entity @s weapon.mainhand from block -573 144 -901 container.0