Placed Item Frames with Invisible NBT tag, lose their NBT when breaking it and picking it up back as an Item Frame.
To reproduce
Run the command
/give @s minecraft:item_frame{EntityTag:{Invisible:1b}} 2
Place one of the item frames
Break the invisible item frame
→ ❌ The item doesn't stack
Comments 4
You can give yourself invisible item frame items, thus it could also be expected that the entity drops the corresponding item.
/give @s minecraft:item_frame{EntityTag:{Invisible:1b}}
I'm pretty sure the item does not retain any of the NBT of the item frame so it would not retain the potion effects either. Maybe edit your datapack to make item frames invulnerable.