Error creating http client: failed to parse TLS CA PEM certificate - error getting datasource info

Trying to configure mTLS in cortex prometheus data source but getting error - error creating http client: failed to parse TLS CA PEM certificate - error getting datasource info
Tested certificates with curl command and they are valid.

Below is the configuration

kind: GrafanaDatasource
metadata:
name: cortex
spec:
instanceSelector:
matchLabels:
grafana: rmagdum
datasource:
name: Cortex
type: prometheus
access: proxy
url: https://otel-cortex-nginx:8084/api/prom
isDefault: true
editable: false
jsonData:
cacheLevel: None
httpHeaderName1: X-Scope-OrgID
httpMethod: POST
prometheusType: Cortex
prometheusVersion: 1.14.0
timeInterval: 15s
secureJsonData:
httpHeaderValue1: rmagdum
tlsCACert: $__file{/etc/pki/client-certs/ca.crt}
tlsClientCert: $__file{/etc/pki/client-certs/tls.crt}
tlsClientKey: $__file{/etc/pki/client-certs/tls.key}

I can see below error log in grafana pod

logger=context userId=1 orgId=1 uname=admin t=2025-02-11T05:45:02.835221068Z level=info msg=“Request Completed” method=GET path=/api/datasources/uid/2b334b95-5146-43b1-bca2-01cb9793f6a7/health status=400

When I manually copies the contents of the certificate files in UI then the connection was successful.