I tried to reproduce the same in my environment via Postman and got below results:
I have one secret named srisecret
in my key vault like below:

I registered one Azure AD application and added API permission for key vault like below:

Make sure to give get secret permission for your service principal in keyvault access policies like below:

Now, I generated one access token via Postman to access Key vault with below parameters:
POST https://login.microsoftonline.com/<tenantID>/oauth2/v2.0/token
grant_type:client_credentials
client_id: <appID>
client_secret: <secret_value>
scope: https://vault.azure.net/.default
Response:

When I used above token to get keyvault secret, I got it successfully like below:
GET https://keyvaultname.vault.azure.net/secrets/<secretname>/<secretversion>?api-version=7.3
Authorization: Bearer <token>
Response:

Alternatively, you can use below c# code in fetching key vault secret:
using Azure.Identity;
using Azure.Security.KeyVault.Secrets;
namespace KVSecret
{
class Secret
{
static void Main(string[] args)
{
const string clientId = "appID";
const string tenantId = "tenantID";
const string clientSecret = "secret";
var credentials = new ClientSecretCredential(tenantId, clientId, clientSecret);
var client = new SecretClient(new Uri("https://yourkvname.vault.azure.net"), credentials);
var secret = client.GetSecretAsync("yoursecretname").GetAwaiter().GetResult();
Console.WriteLine(secret.Value.Value);
}
}
}
Response:

The mentioned php link in comments is for fetching keyvault secrets via managed identities.
For this, you need to enable system-assigned managed identity like below:

You need to give get secret permission to this managed identity by creating access policy like below:

Now, you can run below php code by installing az-keyvault-php
package:
$secret = new AzKeyVault\Secret('https://yourkvname.vault.azure.net');
$value = $secret->getSecret('yoursecretname');
echo $value->secret;