This is not a do-it-yourself project, like fixing a leaky faucet, that you can handle with a little advice over the Internet. You need an attorney to handle it.
I don't see a claim of duress. You wanted to get out of jail, so you took a deal. However, if your medication prevented you from understanding what was happening, or if your attorney didn't adequately inform you of the consequences, you may be successful.
On the downside, judges usually go through a script when taking a plea, asking people if they are on medication, understand their rights, and had enough time to speak to their lawyer. In a felony case, there's almost always a written plea form as well.
I'm also a little confused that you had a Cruz waiver. That means the judge promised you would get probation, NOT go to state prison... but if you fail to show up for sentencing or commit a crime before then, your plea stands but the judge can send you to prison.
You need to file a motion to withdraw the plea before sentencing. If that's what you want to do, get moving now.
Please understand that this is a general discussion of legal principles by a California lawyer and does not create an attorney/client relationship. It's impossible to give detailed, accurate advice based on a few sentences on a website (and you shouldn't provide too much specific information about your legal matter on a public forum like this site, anyway). You should always seek advice from an attorney licensed in your jurisdiction who can give you an informed opinion after reviewing all of the relevant information.Ask a similar question