According to the information you provided, you encountered an error while trying to demot the domain controller to a standalone server, indicating that the trust relationship could not be deleted. Here are some possible solutions:
1. Ensure that the account you are using has sufficient permissions to remove trust relationships. Typically, this needs to be done using a domain administrator account or its equivalent.
2. Ensure that the account you are using has the proper network permissions. If you are trying to delete a trust relationship with another domain controller, your account needs to have administrator rights in both domains.
3. Ensure that the network connection of your domain controller is normal and you can access other domain controllers. If your domain controller cannot connect to other domain controllers, you may not be able to delete trust relationships.
4. Make sure you are using the correct domain administrator credentials. If you are using incorrect credentials, you may not be able to remove the trust relationship.
If the above methods do not solve the problem, you can try to manually remove the trust relationship at the command prompt using the following command:
/Domain: /remove /force
Where, is the name of the trusted square domain, is the name of the trusted square domain. This command forces the deletion of the trust relationship, including all associated objects and properties.
Finally, after removing the trust relationship, you can follow these steps to degrade the subdomain controller to a standalone server:
1. In the server Manager window, select Roles and click Delete Roles.
2. In Delete Role Wizard, deselect Active Directory Domain Services and click Next.
3. On the confirmation page, click Delete to start the degradation process.
Note: The degradation process cannot be undone. Before demoting the subdomain controller, be sure to back up your data and make sure you are doing it correctly.