CXone Studio: Session Handover to Agent Failing with 400 Bad Request

I am trying to handover a session from NICE Cognigy to a CXone agent. The Studio script calls the handover action but it keeps failing. Here is the payload:

{
 "target": "agent:12345",
 "mediaType": "voice"
}

The response is 400 Bad Request with message Invalid target identifier. I have checked the agent ID and it is correct. Why is this failing?