Try unlocking the APFS drive with the following commands:
First, list all external partitions connected to your Mac:
diskutil list external
Note down the disk identifier of the unmounted APFS partition and replace disk3s2 in the command below with it to unlock the encrypted APFS volume and mount it on Mac.
diskutil apfs unlockVolume disk3s2
If you still can't unlock the APFS external drive, recover its data, and reformat it is your last resort.
To retrieve data from the encrypted APFS external disk, you can use iBoysoft Data Recovery for Mac. It's a reliable data recovery app that allows you to retrieve images, videos, audio, documents, and other types of data from encrypted APFS drives and drives with other formats.
It's compatible with various storage devices, such as external hard drives, USB flash drives, SD cards, SSDs, etc, supporting all macOS versions after OS X Yosemite. It also works perfectly with Intel-based, T2, M1 and M2 Macs.
Download it to preview files on the encrypted APFS drive for free!