When a program using openssl library is using a certificate, does the server check if the issuer(s) are still valid
The server may react as it pleases. The TLS spec doesn't come with application instructions in this regard.

The client should definitely reject any certificate chain it manages to build with an expired certificate. That means that the handshake should fail and the TLS session will not be instantiated. This requirement depends on a clock available to the client - which may be tricky in itself for certain environments.

It doesn't matter that the chain only consists of two certificates; root and leaf certificate.