Barry Webb, in Five Festal Garments, suggests that the epilogue locates the Qohelet, the writer of Ecclesiastes, in the mainstream of Israelite wisdom (while I think he’s writing against certain elements of the wisdom movement), and that it is therefore inappropriate to see his teaching as a direct attack on Solomonic wisdom, especially in the canonical form in which we have it in the book of Proverbs. But…
“Clearly there is a tension between them that is evident in the body of the book… and which can not be ignored in any responsible reading of it. The difference relates essentially to the way the doctrine of creation functions in the two works.”
Ecclesiastes draws deterministic inferences from creation. For example, that the creator of the world is responsible for good times and bad (7:14), and that he has set limits to human knowledge (3:11), so we are therefore never in a position to secure guaranteed outcomes for particular behaviour.
Proverbs, on the other hand, sees creation as equally important, but is less influenced by the fall account, and more open ended and positive. It sees the created order as an expression of the wisdom of God (Proverbs 8:22-30). Which brings a confidence that careful observation can enable the gaining of wisdom, which will mostly lead to some modicum of success.
“These two works are certainly in tension, but not in fundamental conflict if we attend to them carefully. Proverbs acknowledges that in the end, it is God, not human beings, who determines the outcomes of events: “In his heart a man plans his course, but the Lord determines his steps” (16:9)… And Ecclesiastes, as we have seen, acknowledges the relative advantage of wisdom over folly (2:13, 10:12). They are both anchored in creation theology, and the fear of God is the essence of wisdom for both of them. Proverbs begins with it, and Ecclesiastes ends with it.”