Starting in verse 2, Solomon, unironically I suppose, is offering the advise to keep the command of the king because of "the oath before the Lord".
"Do not be in a hurry to leave him."
"Do not join in an evil thing against him."
"He'll do whatever he pleases."
Don't question him.
Keep in mind, the man giving this advise is the sitting king at the time. And has forsaken the Lord.
I think the advise stands. As long as God kept him on the throne. But it is such a self-serving mess to say Don't question the king while he's building structure to worship his wives' gods and giving away land that belongs to God. And using forced labor from his people.
It does seem like someone should question him.
He does seem to recognize there is an authority over him.
He laments that wicked are not punished immediately for their sin because it leads to them sinning more and more and maybe even lengthening their days (usually the promise to the righteous). But ultimately, he knows it does nit end well for the wicked, because he does not fear God.
He also sees the reverse where a good man doesn't get paid back for his righteousness. It brings him back to his conclusion that it's best to eat, drink, be merry, and find your happiness in the work of your hands.
He concludes the chapter by deciding that no man can discover the work that is done under the sun. No one can understand God's work.
I wonder if all of that time with those in Egypt for whom he had so much respect and his Egyptian wife actually made him wonder if he was a god himself. He seems to have gone looking for something and the reality of God kept interrupting his brooding investigations.
God is like that. He is faithful and just and keeps meeting us where we are at and urging us back to the narrow path He has established for us.