Occasionally, Webmail users (Horde or Roundcube) on cPanel server may see the following error: Server Error: UID SORT: Internal error occurred. Inbox may not load at all.
It's a permission issue which can be fixed by following command via Shell (root access is required):
If it didn't fix, please check maillog:
grep domain.tld /var/log/maillog
You should search for any errors associated with Dovecot imap. You may find something similar to: