To Reproduce:
[media]Empty your inventory.
Put some item in the first slot of your hotbar.
Execute this command:
/data get entity @s Inventory
✔ Your inventory has a sword on server-side
Clear your inventory by shift-clicking the Destroy Item slot.
Quickly put the same item back by hovering your cursor on that item and then pressing 1.
Execute this command.
/data get entity @s Inventory
❌ Your inventory is empty on server-side.
Can confirm in 21w13a.