How to delete expired certificate

Hi, I tried to use the echo "del ssl cert /etc/haproxy/certs/test.pem" | socat /tmp/haproxy.sock, but I get the following error:

Can't remove the certificate: certificate '/etc/haproxy/certs/test.pem' in use, can't be deleted!

What is the correct way to mark a certificate as unused so that it can be deleted?

I’m using 2.7.6.
show ssl cert /tmp/test.pem shows Status: Used

The certificate was loaded by being included in a directory with
bind 443 ssl crt /etc/haproxy/certs/ alpn h2,http/1.1