In Islamic Shariah, khula can take place with the consent of husband and wife. On what basis the court had given the ruling of khula, please furnish all details along with the court verdict, then we can have a say in the matter. It is better to contact local Ulama and Muftis.
Allah (Subhana Wa Ta’ala) knows Best
Darul Uloom Deoband