This error comes when users are assigned custom permission sets that do not include all codeunits,
All default permission have Execute Permission for Codeunit 0, which means all Codeunits.
Assign the User permission for all codeunits.
Another suggestion for similar issue. This problem is caused by "SEARCH ITEMS" permission set as it is the only one unrestricted to a company. The system tries to open this company and the User does not have sufficient permissions for this company:
- Add the company name on "SEARCH ITEMS" permission set
- Remove "SEARCH ITEMS" permission set
- Assign the Company in the User personalizations page for the affected user