This error is normally due to an invalid
nonce (a token used by WordPress to authenticate the request being made against the user that is logged in). If the
nonce fails, you’ll see this error.
Unfortunately, there’s not a simple fix; it’s trial and error. The first thing you’d want to do is disable all plugins. Plugins hook in to the core, thus they have the ability to change what is output to the browser (thus, they have the ability to cause issues if something isn’t quite right) , so to stop that, we need to disable them all so that we’re running as close to stock as possible.
With all plugins disabled, log out, log back in and try to upload the theme. If it works, you can then start enabling plugins one-by-one until you run in to a similar issue. When you see the same issue pop up, you’d now want to see what the last plugin you enabled was and check any error logs you may have in your home directory.
If the above doesn’t work, the best thing to do would be to simply download a fresh copy of WordPress, backup your current files and then overwrite the current files with those from the freshly downloaded WordPress ZIP. If you’re running an older version of WordPress than is current, now would be a good time to upgrade (otherwise do not perform this step).