Is there a specific PHP error that is causing the rights not to be assigned to some clients?
It is possible that there may be a PHP error in the code that is preventing the rights from being assigned to some clients. To solve this issue, you can check for any error messages in the PHP error log or enable error reporting to see if there are any specific errors related to the rights assignment process.
// Enable error reporting to display any PHP errors
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Your code for assigning rights to clients goes here