In that case, I am afraid this won't be possible.
The CNAME inherently takes the RG of the DNS Zone in which it resides. We cannot change this behavior.
Instead, we must take the precaution to delete the CNAME record either manually or programmatically when you delete the App Service or App Service's custom domain. In Powershell,
Remove-AzDnsRecordSet -Name "<CNAMERECORDNAME>" -RecordType CNAME -ZoneName "<DNSZONENAME>" -ResourceGroupName "<RGNAME>"
Remove-AzDnsRecordSet -Name "<TXTRECORDNAME>" -RecordType TXT -ZoneName "<DNSZONENAME>" -ResourceGroupName "<RGNAME>"
Hope this helps.
Should there be any follow-up questions or concerns, please let us know and we shall try to address them.
Thanks,
Kapil