I could recreate a similar bug in 1.17.1 with a function on tick
execute as @a[team=blue,nbt=!{Inventory:[{id:"minecraft:tnt"}]}] if score Aqua tnt matches 1.. if score match match matches 2 run function tntbattle:tnt-blue
give @s minecraft:tnt 1
scoreboard players remove Aqua tnt 1
Can reproduce in 1.21.1 with a datapack:
function called from
tick.json
:give.mcfunction
:When dropping the dirt, a new one correctly appears in the inventory, when placing it, the new one is invisible.