Do you have any idea why it's not working correctly?
$resut = az sql db show --name "NotExistingDB" --resource-group "rg" --server "server" | ConvertFrom-Json
checking if database exists - it should return false because it does not.
$? :- Writing result of last command, it returns $true in my case but should return $false.



https://github.com/Azure/azure-cli/pull/24015
This change caused a number of issues and is being reverted. Though your specific issue is not listed, I can also reproduce it and it fits with the change. A fix will be released soon as far as I can see.
You can also try going back to an old version of Azure CLI to see if that fixes the issue.