How to reproduce
Set a jukebox with a recorditem
/setblock ~1 ~ ~ minecraft:jukebox{RecordItem:{id:"minecraft:dirt",Count:1b}}
Remove the item
/data remove block ~1 ~ ~ RecordItem
Run command to see the tag still exists
/data get block ~1 ~ ~
Set a jukebox with a recorditem
/setblock ~1 ~ ~ minecraft:jukebox{RecordItem:{id:"minecraft:dirt",Count:1b}}
Remove the item
/data remove block ~1 ~ ~ RecordItem
Run command to see the tag still exists
/data get block ~1 ~ ~
AlexMCool
slicedlime
Confirmed
Commands
/data-remove, jukebox
Minecraft 1.13.2, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w46a, ..., 1.17.1, 1.18.2, 22w18a, 1.19.4, 1.20.2
1.21.4 Pre-Release 1
Retrieved
You can find more of these issues with most "optional" tags. So even if it would be convenient to have some of these fixed, in the general case, I think it falls under the "changing the nbt in the block/entity lifetime" category.