All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
First of all, we say that the story that you mentioned was reported by Al-Hasan Al-Basri, Qataadah, and Muqaatil, but it does not have an uninterrupted chain of narrators to the Prophet according to the resource books that we have at hand. Rather it is a mursal hadeeth (a report narrated on the authority of some of the Taabi'oon [the generation that followed the Companions]), which is one of the categories of weak ahaadeeth.
It was narrated as Mursal by Abu Dawood in his Maraaseel and by Ibn Jareer At-Tabari and Ibn Abi Shaybah and others.
Ibn Hajar said:
"Muqaatil said, ‘It was revealed about Sa’d ibn Ar-Rabee’, who was one of the Nuqabaa' (the twelve leaders of Ansaar [the people of Madeenah] whom the Prophet appointed after the allegiance of 'Aqabah to take charge of the affairs of Madeenah), and his wife was Habeebah bint Zayd ibn Abi Zuhayr, and both of them are from the Ansaar.
She became rebellious against her husband, so he slapped her. Thus, her father went to the Prophet along with her and told him, 'I married off my daughter to him, and he slapped her,' so the Prophet said, 'Let her seek retribution against him.' So she went away with her father to take revenge from him. Then, the Prophet called them back and told them, 'Jibreel (Gabriel) came to me and informed me that Allah Almighty revealed (what means): {Men are in charge of women by [right of] what Allah has given one over the other…} [Quran 4:34];' thereupon, the Prophet said, 'We wanted a matter and Allah decreed another matter, and the good is in what Allah decreed,' and he cancelled the retribution.’”
Therefore, based on the above, the story is not reported with a chain of narrators to the Prophet ; rather it is a mursal hadeeth, which is one of the categories of weak ahaadeeth; so the Quran cannot be contradicted with it.
There is no doubt that the Prophet does not speak of his own inclination; it is not but a revelation revealed. Allah revealed to His Prophet two things which Allah mentioned in His saying (which means): {And Allah has revealed to you the Book and wisdom...} [Quran 4:113]
Ibn Al-Qayyim said, “The book is the Quran, and the wisdom is the Sunnah as agreed in a consensus by the scholars of the Salaf (righteous predecessors).”
However, the verse: {Nor does he speak from [his own] inclination. It is not but a revelation revealed.} [Quran 53:3-4] does not mean that all what the Prophet uttered was revelation from Allah, but its meaning is that the Prophet is infallible in regard to what he informs on behalf of Allah, unlike other ordinary speech or Ijtihaad (independent reasoning); it is for this reason that the Prophet said, “Whatever I told you is from Allah (divine inspiration), it is beyond doubt.” [Al-Bazzaar and Ibn Hibbaan in his Saheeh]
Besides, it is confirmed that the Prophet, sallallaahu ‘alayhi wa sallam, once passed by people who were busy artificially pollinating the date palm trees. Thereupon, he, sallallaahu ‘alayhi wa sallam, said, “If you were to not do it, it might be good for you. (So they abandoned this practice) and there was a decline in the produce.” He later happened to pass by them and said, “What has gone wrong with your trees?” They said, “You said such-and-such (and we acted upon your words).” Thereupon he said, “You have better knowledge about the affairs of your world.” [Muslim]
Another narration by Ahmad and Ibn Maajah reads, “…When the matter is related to worldly affairs, manage it in the way you find suitable; however, if it is related to your religion, abide by my commands.” [Ahmad and Ibn Maajah]
Another version reads, “...If it is related to your worldly affairs, you are more knowledgeable of your own affairs; if it is related to your religion, it should be referred to me.” [Ahmad]
This does not mean that the Prophet, sallallaahu ‘alayhi wa sallam, speaks in other than the Quran with falsehood or based on personal inclination; rather, its meaning is that it could be an Ijtihaad from him, and Allah may endorse it or negate it. Allah would not endorse him about his Ijtihaad if he was mistaken, nor about a matter which Allah does not will. Rather, Allah clarified the Sharia which He wants to him, and so, he would uttered it, and this is revelation.
For more benefit on the status of the Sunnah in legislation, please refer to fatwa 92485, and to fatwa 4049 on the evidence on the obligation of following the Sunnah, and to fatwa 88168 on the difference between the Sunan (practices of the Prophet) of habit and the Sunan of legislation.
Allah knows best.