@Siva I understand that you are trying to retrieve disk backup history. I have done small modifications to your existing code. The reason you were prompted with mentioned error is because the command "Search-AzDataProtectionJobInAzGraph" accepts the subscription Id instead of subscription name. The value you are passing is subscription name.
$Subscriptions=@('Subscriptionname')
$ErrorActionPreference = 'stop'
foreach ($sub in $Subscriptions)
{
$subname = Get-AzSubscription -SubscriptionName $sub
Set-AzContext -Subscription $subname.Id
$TestBkpVault = Get-AzDataProtectionBackupVault -VaultName "testvault" -ResourceGroupName "Backuprg"
$TestBKPVault | fl
$endtime = Get-Date
$starttime = $endtime.AddHours(-20)
$job = Search-AzDataProtectionJobInAzGraph -Subscription $subname.Id -ResourceGroup "Backuprg" -Vault $TestBkpVault.Name -DatasourceType AzureDisk -Operation ScheduledBackup -StartTime $starttime
$job
}
If the above solution has helped , kindly "Accept as answer" or "upvote", so that it would be beneficial for other customers who are looking for similar solution.