first thing is format of private key should be like that
$privateKey = <<<EOD
-----BEGIN EC PRIVATE KEY-----
<your key here>
-----END PRIVATE KEY-----
EOD;
second thing wrong string being signed correct one :
$bodyJson = json_encode(...);
$bodyHashBinary = hash('sha256', $bodyJson, true);
$bodyHashBase64 = base64_encode($bodyHashBinary);
$messageToSign = $date . ':' . $bodyHashBase64 . ':' . $urlSubpath;
third thing invalid date format correct
$date = gmdate("Y-m-d\TH:i:s\Z");