I have thought of a dozen reasons that cause your iPad to fail to unlock the APFS encrypted drive in Files, which might be the following: the format failure of the Mac computer, the connection trouble, the iPad's corruption, and drive failure.
Changing a cable or adapter to make the connection firm and stable helps a lot in troubleshooting this weird issue.
Or, you can format the external hard drive by changing the computer to see if the APFS encrypted drive works fine on the iPad.
Once the iPad gets corrupted, it fails to recognize or unlock any drive. Facing this, you'd better take it to the repair center near you for a professional mend.
On top of all that, the moment your drive fails, you can't unlock it on iPad and macOS any longer. You'd better perform the APFS drive data recovery on Mac as quickly as possible and then purchase a new one for further storage purposes.