Today my father has the 50th yahrtzeit for his father
לעילוי נשמת אברהם בן חיים יצחק ע"ה
The gemara says that since kibud av is such a great mitzvah, one would have thought that if a father told a son to violate an aveira such as entering a cemetery (for a kohen), or not to return a lost object that the son should obey the command of the father. The gemara requires a special pasuk of "ani hashem" to teach that the son shouldn't listen to his father to do an aveira. Tosafos writes in Kiddushin 32a that the case where the father tells the son not to return the aveida cannot refer to a case where the father says "don't return that aveida" because then it is obvious that the son should not listen and we wouldn't need a pasuk to teach that. Rather the case that the pasuk comes for is when the father says to the son "get me a glass of water" and the son is faced with the conflict of kibud av or hashavas aveida.
Why is it so obvious that if a father would tell a son not to return an aveida, that the son should not listen? Why is a pasuk not necessary to exempt the son from listening to his father in that case?
The ya'avetz in kiddushin says that by the father telling the son not to do the mitzvah of hashavas aveida for no rhyme or reason, the father is a rasha, so the son shouldn't listen. In truth though, whether or not there is a mitzvah of kibud av for a father who is a rasha is a machlokes shulchan aruch and rama (240:18). According to the ya'avetz the tosafos would conform with the opinion of the rama.
However, the ritva in baba metzia says that since this type of command does not provide any benefit to the father, this type of command is not included in the mitzvah of kibud av. The Gr"a at the end of hilchos kibud av (240:36) quotes this opinion in the name of the Ramban and Rashba:
לפי שאין עיקר כיבוד אלא במה שיש לו הנאה כמש"כ בקדושין לא ע"ב איזהו כיבוד וכו' אבל אמר לו לעשות דבר שאין לו בה הנאה וכו'ומה שכתב "יכול א"ל אביו היטמא" לא לחנם אלא להביא פירות מבית הקברות וכיוצא וכן אל תחזיר כדי שלא יבטל מלהאכילו
The difference between the approach of the ritva and the ya'avetz is if the father would tell the son "don't return the aveida, rather get me a glass of water" - based on the ya'avetz one can argue that this would also render the father a rasha so we wouldn't need a pasuk to exempt the son. But according to the ritvah this would be a case where there is a mitzvah of kibud av so we would need a pasuk to exempt the son.
In short, the gemara according to tosafos compels one of the two halachos - either there is no mitzvah to listen when the father receives no benefit, OR there is no mitzvah to listen when the father says to do an issur since by the command he renders himself a rasha.
The Pischei Teshuva (14) has a discussion about a father who tells his son not to say kaddish for the mother - should the son listen? The maharshal says that the son shouldn't listen since it would be like a violation of an issur d'rabonon. But the birkei yosef challenges this notion whether saying kaddish is actually considered an issur d'rabonon since in truth it is no more than a custom. However, the pischei teshuva writes that the son shouldn't listen because even if kaddish is not a real mitzvah, the father by giving a command not to say kaddish for the mother would be in violation of ואהבת לרעך כמוך. This implies that although it is not an issur from the perspective of the son, since the father renders himself a rasha through his command, the son shouldn't listen. Being that we follow the rama and hold that there is a mitzvah to listen even if the father is a rasha, perhaps the son should listen.
Nonetheless, based on what we said above, Tosafos compels that either there is no mitzvah of kibud av on something that he receives no benefit from, or that there is no mitzvah to listen to a father who is a rasha. Therefore, in the case where the father would render himself a rasha through his command AND he is giving a command that he receives no benefit from, we are compelled according to both explanations of tosafos to say that the son shouldn't listen to the father.