Issues creating a ProjectWise 365 project using Add-PW365Project

We're trying to create ProjectWise 365 projects using PowerShell, but we're encountering some issues trying to get it to work.  I've more or less copied the example given in the help dialog for the Add-PW365Project command--script shown below:

Upon attempting to run this script, we're encountering some errors.  We're getting either a "object reference not set to an instance of an object" error, or a "unrecognized Guid format" error:

What's odd is that the (rich) project does get created and can be seen in ProjectWise Explorer...

And it can also be seen in our ProjectWise 365 portal...

 .

However, upon trying to open the project in the portal, we're getting this message:

And then when we click on the link, we get this:

So now we have these projects that are currently "stuck" in our portal which are displayed, but are not provisioned--and as such, we can't get rid of them.  The only thing we can think of that might be causing the error is the $pw365id variable in the script not having the proper guid format.  The example given in the help for the Open-PW365Project command shows the following:

We think that the $pw365id variable is not returning the correct guid format.  If there's a way to get the guid of the ProjectWise 365 project, perhaps that might help us out.