No matter how high a stage a wali may attain, he will never be equal to a Prophet.
No matter how beloved a wali is to Allah, he is not absolved of observing Shariah. Salah, fasting, and other act of worship must be observed and sinful deeds should be avoided.
The person who acts contrary to the Shariah cannot be a friend of Allah. If he does some miraculous act, then it is either magic or something enacted through the influence of the soul or satan. These things should not be believed in.
At times, a wali comes to know of certain mysterious things either in his sleep or while awake. This is known as kashf or ilhaam (manifestations or inspirations). If these things are in conformity with the Shariah, they are acceptable, if not, they have to be rejected.
Allah and His Messenger sallallahu alayhi wa sallam have shown all the matters pertaining to the Deen in the Quran and Ahadith. To introduce new thing into religion is not permitted. Such new things are known as bid'aat (innovations). An innovation is a major sin.