security – browser that replaces the expired certificate

I am connecting to a specific web server through a firewall, but when I do, the firewall alerts me that the certificate has expired. I took a closer look and discovered that the browser is replacing the expired certificate sent by the server with one that did not expire in the Windows certificate store. Apparently, they have the same descriptive name and possibly other similar properties (of course, the public key is the same). Since IE / Chrome are doing the same, it looks like some Windows features used by browsers. Why does that happen? How can the certificate be replaced? Is there a potential danger that you do not know about?