Yes, I have experienced this before. Quit now and save yourself months of agony. Even if you somehow win this battle, you're still going to lose the 'CEO is an idiot' war.
Let me repeat this again: QUIT NOW. Save yourself the pain. You have already lost because you work for an idiot. Don't throw good money after bad.