[On the earth]...
[On the earth], a guidance will certainly come to you from Me, and then whosoever follows My guidance, he shall not go astray nor will he be unhappy. But whosoever turns away from My reminder, then he shall surely have a wretched life and we shall resurrect him blind.” Review of Adam’s Story According to the experts of Islamic jurisprudence, the orders given by Allah are of two types: Al-amr al-mawlawi, a legislative command.
Such orders must be implemented; and, if someone disobeys such a command, then he is committing a sin and is liable to be punished. For example, the command to “say the daily prayers” or “do not eat the pork” is of such nature. Neglecting the daily prayers or eating of the pork is a sin and Allah can rightly punish the sinner. Al-amr al-irshadi, an advisory command. Such orders are of advisory nature; their purpose is to inform the people about its consequences.
However, if someone disobeys such an order, then he is not committing a sin; of course, he will have to face the consequences of not following the advice. For example, the command to “say bismillah when you slaughter the chicken” is of advisory nature. Now, if someone slaughters the chicken and neglects the saying of “bismillah,” then has he committed a sin? No, he has not committed a sin nor is he liable for a punishment for not saying the “bismillah” at that time.
However, he will lose the right to eat that chicken; that chicken cannot be eaten by a Muslim. Another example: a person comes to his doctor complaining of cough. The doctor advises his patient to drink a certain medicine, a cough syrup. Now if the patient ignores that advice, then he is not committing a sin or a crime; but he will surely suffer the consequence — his illness will be prolonged and his health might deteriorate.
Conclusion : not all commands of Allah are of obligatory or prohibitive nature. The advice given to Adam and Hawwa was not of the legislative nature. It was not that that particular tree and its fruit themselves were forbidden. The prohibition of going near that tree and eating its fruit was al-amr al-irshadi. And going against such an order is not a sin; at most, the doer will have to face the consequences of ignoring that advice.
In case of Adam and his wife, the consequence they faced was cancellation of their tenure as guests of Allah in the Paradise and its comforts.