Unfortunately, there's not really a lot you can do. This is why Square implemented a confirmation dialogue for items that can't be equipped by your current class, to try and prevent stuff like this.