Islam has prohibited any kind of magic and it is considered a Haram act. Generally, seeing yourself doing magic in a dream has a bad meaning as per Islam.
1- According to Ibn Sirin رحمة الله عليه, the greatest dream interpreter of Islam, doing magic in a dream means that the person will get involved in shameless and faulty acts.
2- If a person sees someone casting magic spells against him, it shows misery and trial for the dreamer.
3- According to Jabar Maghrabi رحمة الله عليه, doing magic in a dream is a sign of telling lies and being fraudulent with others. Magic in dreams is a sign of enemy who betrays.