You must fix in your script the user role name:
$struct->role = 'SiteOwner';
User role name is "SiteOwner", not "Site Owner".
Also, you must define the plan for user. Yuo must create the plan and then got it UUID. The correct way to get the UUID of the plan is to use methods from...