Programmatically add new role to group member
I was eventually able to find the correct process.  The working code follows:

// Get the group owner
$owner = $group-&gt;getOwner();

// Get the membership details of the owner
$membership = $group-&gt;getMember($owner);

// Get the roles of the owner
$roles = $membership-&gt;getRoles();

// Check whether the owner has manager role
if (!isset($roles['client-manager'])) {
  // No, so add the manager role to the membership
  // Get the group_content entity
  $group_content = $membership-&gt;getGroupContent();
  // Set target group role
  $group_content-&gt;group_roles-&gt;target_id = 'client-manager';
  // Save updated entity
  $group_content-&gt;save();
}


Thanks for your help.