For anyone else who has this problem I figured out the solution was due to different .dll's used for sharepoint vs sharepoint online.
Working code for sharepoint online is:
$SiteURL = "Your URL Here"
Connect-PnPOnline -Url $SiteURL -UseWebLogin
$Site = Get-PnPSite -Includes CustomScriptSafeDomains
This allows for any domain
$site.AllowExternalEmbeddingWrapper = [Microsoft.SharePoint.Client.ScriptSafeExternalEmbedding]::AllowedDomains;
This blocks any domain
$site.AllowExternalEmbeddingWrapper = [Microsoft.SharePoint.Client.ScriptSafeExternalEmbedding]::None;