Firstly it should not break anything, it won't even be called unless another inventory type is added without being added to the switch.
But if this isn't updated the method is used in CraftHumanEntity#openCustomInventory, which wouldn't be called without a switch being updated above it and in this class, on open for this container. 
The reason i changed it was to show its an error and i believed that it would be better to not have it open a random inventory rather than the one specified, however thinking about it maybe it would have been better just to throw an exception.