Please add ContentType "application/xml; charset=utf-8" to your Invoke-Resetmethod
$response = Invoke-RestMethod -Uri $graphapiuri -Method Put -Body $policycontent -Headers $headers -ContentType "application/xml; charset=utf-8"