Yes. If the last day of validity of your residence card fell during the period of an epidemic/epidemic state, announced in connection with SARS-CoV-2 virus infections, the validity period of this residence card will be extended by operation of law until the 30th day following the day of cancellation of this states which were last in force. This means that you have the right to use your residence card as valid despite the expiry of the validity end date specified therein. With such a residence card, you retain the right to cross the polish state border. You can legally leave Poland straight to your country of permanent residence and come back to Poland, there will be no possibility of transit, e.g. from Poland via German, on extended resident card
For details check here: https://udsc.gov.pl/en/cudzoziemcy/coronavirus-outbreak/