Not able to remove Activation Lock through MDM

I am not able to remove the Activation Lock through MDM. I enabled the activation lock via https://mdmenrollment.apple.com/device/activationlock My device is listed in the ABM portal and i used the provided snippet here to generate the bypass code.

I am getting the SUCCESS response of the above API and the activation lock also got enabled. But while removing the above activation lock via https://deviceservices-external.apple.com/deviceservicesworkers/escrowKeyUnlock and using the same escrow key that I used in the above api while activating the lock. I got the following error everytime

<?xml version="1.0" encoding="UTF-8"?><ns:escrowKeyDeviceServicesResponse version="1" xmlns:ns="http://www.apple.com/cds/mdmescrowKeyDeviceServices/xml"><error code="1002" message="com.apple.cds.cyclops.mdm.MDMServiceException: Escrow key mismatch"/></ns:escrowKeyDeviceServicesResponse>

Though this API of clearing the activation lock works perfectly fine when I enable the user-initiated activation lock, by enabling the Find My in the device. And use the bypass code as escrow_key that we receive from the device via device querry command.