execute as @e[type=minecraft:item_frame,nbt=!{Invisible:1b},tag=!rotate_only] run data merge entity @s {Fixed:0b}
execute as @e[type=minecraft:item_frame,nbt=!{Invisible:1b},tag=!rotate_only] unless data entity @s Item run data merge entity @s {Invulnerable:1b}
execute as @e[type=minecraft:item_frame,nbt=!{Invisible:1b},tag=!rotate_only] if data entity @s Item run data merge entity @s {Invulnerable:0b}

execute as @e[type=minecraft:glow_item_frame,tag=rotate_only] run data merge entity @s {Fixed:0b,Invulnerable:1b}