The code which prepends the scheme and host to the request URI is only executed when the method is GET.
Repro:
Invoke-MgGraphRequest `
-Method POST `
-Uri "/beta/directoryObjects/getByIds" `
-Body @{ "ids" = @([Guid]::NewGuid().ToString()); "types" = @("user") }
Invoke-MgGraphRequest : This operation is not supported for a relative URI.
At line:1 char:1
+ Invoke-MgGraphRequest -Method POST -Uri "/beta/directoryObjects/getBy ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-MgGraphRequest], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Authentication.Cmdlets.InvokeMgGraphRequest
This issue is mentioned in passing in #887, but I think it's deserves a separate issue, as the root cause appears to be unrelated.