I have just discussed with Microsoft engineer about this issue.
It's true that it's possible to request deletion of these attributes from microsoft but only if dirsync is turned off.
So if you're converting users to cloud only by deleting and restoring from azure ad, keep in mind that it's not officially supported way to do so.
What needs to be done is turning of dirsync, that's the proper way of converting users to cloud only. But in this case it will happen for all users, so you can't convert users to cloud only one by one. it has to be all or none.
By the way, new graph beta can finally see these attributes but can't delete because they're read only.
This script will show the attributes and then fail to delete
Update-MgBetaUser_UpdateExpanded: Property 'onPremisesSamAccountName' is read-only and cannot be set. Status: 400 (BadRequest) ErrorCode: Request_BadRequest Date: 2024-07-23T21:40:28 Headers: Cache-Control : no-cache Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000
# Install the experimental Graph SDK module
Install-Module -Name Microsoft.Graph.Beta -AllowClobber
# Import the module
Import-Module Microsoft.Graph.Beta
# Connect to the Graph Beta environment
Connect-MgGraph -Scopes "User.ReadWrite.All"
$user = Get-MgBetaUser -UserId "user@domain.com"
$user | Select-Object -Property OnPremisesSamAccountName, OnPremisesUserPrincipalName, OnPremisesDomainName, OnPremisesSecurityIdentifier, OnPremisesImmutableId
# Update the user attributes
Update-MgBetaUser -UserId $userId -OnPremisesSamAccountName $null -OnPremisesUserPrincipalName $null -OnPremisesSecurityIdentifier $null