There is more to the story
There is a considerable moral problem with such a self-serving revelation. It is quite clear that Prophet Muhammad was attracted to Zainab before Zaid divorced her and it might well have been the true reason for the divorce itself. And Qur'anic verses do make clear that there was something going on before Zaid divorced Zainab. The entire melodrama: Zaid's divorce of Zainab, Muhammad's marriage with Zainab and subsequent revelations of several Qur'anic Ayats from Allah to purify this scandalous happening is something to ponder very seriously. There is more in this strange story. That this action is immoral and this revelation/justification of it self-serving and not fitting for a true word of God is an important aspect, but not a contradiction within the Quran - even though contradicting the true character of God, who is moral purity.