Afaik this can only be managed in the GUI, and if it's glitching, your only option is to work with support.
Cloud shell remove to DNS txt record
Hello
We have a problem in 365 DNS where we have duplicate SPF txt records but with different values. We have one in Custom records and the correct one under Exchange. We cannot delete the rogue custom record. It declares itself as being deleted but then instantly returns. Running public DNS checks, we can see there is an SPF conflict which we believe is causing issues with the mail servers of a major ISP
Does anyone know the explicit cloud shell command to remove the custom record? MS Support aren't much help at the moment asking us to run and supply logs on the browser interaction which is not the problem.