The subject error message is:
DsRemoveDsDomainW error 0x2015 (The directory service can perform the requested operation only on a leaf object.)
This behavior may occur when the application partition naming context (DC=DomainDnsZones) for a child domain is not removed when the domain controller demoted.
To fix this problem:
1. Start / Run / ntdsutil / OK.
2. Type domain management at the Ntdsutil command prompt and press Enter.
3. Type connections and press Enter.
4. Type connect to server <Domain Controller Name> and press Enter.
5. Type list at the domain management prompt and press Enter.
6. Type DC=domaindnszones,DC=<Child Domain>,DC=<extension>
7. Quit Ntdsutil.
NOTE: See How do I remove a domain controller from Active Directory after an unsuccessful demotion?