You'll come across dozens of chests while exploring Hogwarts and the surrounding Highlands. However, if you open these chests while your inventory is full, they will glitch, and you won't be able to take their contents even if you destroy or sell items in your inventory. There's no fix for this of yet, so make sure to check your inventory regularly. If you're fed up with sorting through your inventory, you can expand its slots by completing the Merlin Trials found across the Highlands.