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 ~ ~
Related issues
Attachments
Comments


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.

Please do not mark unreleased versions as affected.
You don't have access to them yet.
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 1.16.5 and 21w08b.
Can confirm in 1.17.
Can confirm in 1.17.1.
Can confirm in 1.18.2 and 22w18a.