Not able to clear an inventory

Hey !
I’m trying to clear an inventory I have previousky created, but when I try to use Inventory#clear() it does nothing. Additionaly, even though the inventory clearly contains items, when I browse through it, I only gen ‘Optional.empty’.

Does it mean the inventory is not properly sync with the client ? I don’t think so because when I add items to the inventory, the are properly shown. How can I clear my inventory?

Thanks

Can you paste some code which can reproduce this issue?