Windows Smart Proxy errors when attempting to delete reverse DNS record when destroying a host

Problem:
Host fails to delete when the assigned subnet assigned a reverse DNS capsule using dnscmd provider.
Expected outcome:
Host should delete without issue regardless of reverse DNS entry exists or not.
Foreman and Proxy versions:
Foreman 3.3.0
Proxy 3.3.1
Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:
I have to use the dnscmd provider for DNS when using Foreman, so I am using a windows proxy to do this. As the problem describes, I am seeing an issue when deleting hosts that are using a subnet with the reverse DNS capsule is using the dnscmd provider. This seems to happen no matter if the reverse DNS entry exists. I have been using this provider for a few years now and this started to break after upgrading to the 3.x version of the proxy. It worked fine on 2.4 and there seems to have been quite a bit of code rework since that version. The odd part is that the reverse DNS record seems to be deleted. Here is the log entry from the DNS server stating that the reverse DNS record is deleted

A resource record of type 12, name 11 and RDATA 0x1B040A62616C6174657374303204636F727005746D6E617303636F6D00 was deleted from scope Default of zone 53.1.10.in-addr.arpa.

The proxy logs show the following error, however I have verified that the record does in fact exist on the DNS record that forman is using.

Command dnscmd failed: DNS Server failed to enumerate records for node 11.53.1.10.in-addr.arpa.. Status = 9714 (0x000025f2) Command failed: DNS_ERROR_NAME_DOES_NOT_EXIST 9714 0x25F2

Below is a snippet of the production log when the error occurs:

2023-01-09T14:40:38 [I|app|3ffc22ff] Delete the DNS A record for balatest02.corp.tmnas.com/10.1.53.11
2023-01-09T14:40:39 [I|app|3ffc22ff] Delete the DNS PTR record for 10.1.53.11/balatest02.corp.tmnas.com
2023-01-09T14:40:39 [W|app|3ffc22ff] Remove Reverse IPv4 DNS record for balatest02.corp.tmnas.com task failed with the following error: ERF12-1261 [ProxyAPI::ProxyException]: Unable to delete DNS entry ([RestClient::BadRequest]: 400 Bad Request) for Capsule https://p00norrhsat002.corp.tmnas.com:8443/dns
2023-01-09T14:40:39 [I|app|3ffc22ff] Backtrace for 'Remove Reverse IPv4 DNS record for balatest02.corp.tmnas.com task failed with the following error: ERF12-1261 [ProxyAPI::ProxyException]: Unable to delete DNS entry ([RestClient::BadRequest]: 400 Bad Request) for Capsule https://p00norrhsat002.corp.tmnas.com:8443/dns' error (ProxyAPI::ProxyException): ERF12-1261 [ProxyAPI::ProxyException]: Unable to delete DNS entry ([RestClient::BadRequest]: 400 Bad Request) for Capsule https://p00norrhsat002.corp.tmnas.com:8443/dns
 3ffc22ff | /usr/share/foreman/app/services/proxy_api/dns.rb:27:in `rescue in delete'
 3ffc22ff | /usr/share/foreman/app/services/proxy_api/dns.rb:21:in `delete'
 3ffc22ff | /usr/share/foreman/lib/net/dns/reverse_record.rb:15:in `destroy'
 3ffc22ff | /usr/share/foreman/app/models/concerns/dns_interface.rb:51:in `del_dns_record'
 3ffc22ff | /usr/share/foreman/app/models/concerns/orchestration.rb:226:in `execute'
 3ffc22ff | /usr/share/foreman/app/models/concerns/orchestration.rb:152:in `block in process'
 3ffc22ff | /usr/share/foreman/app/models/concerns/orchestration.rb:144:in `each'
 3ffc22ff | /usr/share/foreman/app/models/concerns/orchestration.rb:144:in `process'
 3ffc22ff | /usr/share/foreman/app/models/concerns/orchestration.rb:60:in `on_destroy'
 3ffc22ff | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:428:in `block in make_lambda'
 3ffc22ff | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:238:in `block in halting_and_conditional'
 3ffc22ff | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:517:in `block in invoke_after'
 3ffc22ff | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:517:in `each'
 3ffc22ff | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:517:in `invoke_after'
 3ffc22ff | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:136:in `run_callbacks'
 3ffc22ff | /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:825:in `_run_destroy_callbacks'
 3ffc22ff | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:309:in `destroy'
 3ffc22ff | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:310:in `block in destroy'
 3ffc22ff | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
 3ffc22ff | /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
 3ffc22ff | /usr/share/gems/gems/active

After stepping a bit more through the logs. It appears the Microsoft DNS server is removing the reverse DNS record when the A record is being deleted. I’m not familiar with Microsoft DNS configuration, but could this possibly be a setting on the DNS server that automatically deletes the PTR when an associated A record is deleted? Seeing this behavior, I’d imagine it would be a good idea to have the provider not return an error if the reverse DNS record is not found. I’m not sure why this wasn’t any issue prior to the 3.0 release though.