Can not decrypt this file[...] on OC Desktop after disabling user encryption and enabling master key encryption

I disabled user encryption key and enabled master key encryption in order to use Onlyoffice.
I can access and edit my files using ownCloud via web, but when I try to sync with ownCloud Desktop, it gives me this:
“500 Internal Server Error” to “GET http://server/file” (Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.)

I’m using CentOS 7 with Apache 2.4. I use ownCloud on both HTTP and HTTPS.
Database MySQL 5.6 with PHP 7.2.

My client machine is Windows 10.

Okay, I deleted all my files and resynced.
I noticed that a particular folder didn’t have any keys in owncloud/data/mateus/files_encryption/keys/files/, so I just deleted the folder since I don’t need it anymore.
Everything seems to be running OK.