If your inventory is full, then you open a chest to get something and you don't have any empty spaces in your inventory the items just clicked on gets deleted. As long as you don't already have that item in your inventory. I click on several different items that I did not have just to make sure and yes they all got deleted.
Related issues
Comments


That issue said they shift clicked a item. I just click the item to drag to my inventory. It also said that issue is resolved but it just happened to me about 15 minutes ago.

It's resolved for the next snapshot. It's not been released yet.
Thank you for your report.
However, your ticket has been resolved as a duplicate.
This issue has been linked to the original bugreport: MC-88929. You can find or add further information on that report.
Please search before reporting any bugs, as it's likely that one exists already.