Failed to shutdown sticky queue unknown method ShutdownWorker

I am new to temporal and using it to start scheduled workflows to rrun after regular interval. Now wheneven I try to end process or restart it it gives me the error. I am using this method to stop it on process.exit
await worker.shutdown();
but gets error
2025-03-26T08:40:07.128846Z WARN temporal_sdk_core::worker: Failed to shutdown sticky queue Status { code: Unimplemented, message: “unknown method ShutdownWorker for service temporal.api.workflowservice.v1.WorkflowService”, metadata: MetadataMap { headers: {“content-type”: “application/grpc”} }, source: None }
this is causing my CI to fail resulting to memory leaks when test ends. Any way to gracefully shutdown worker in typescript

If I dont use any method I still gets same error

Are you by chance throwing WorkflowError from your workflow code? If so throw ApplicationFailure instead

For anyone who stumbles upon this, I believe this is related to shutting down workers in a TestWorkflowEnvironment. I have not found a workaround for this yet.