Not sure if it's a bug or not, but minor illusion should be able to be casted from stealth like it says in its tool-tip description. Instead, it takes you out of hiding and starts combat.