I had an external hard drive that I overfilled by accident while making a manual backup of media files, and after that I couldn't even mount the APFS volume. Apparently it's something that can happen.
In the end I was able to mount and rescue the data using https://github.com/libyal/libfsapfs
I followed this guide: https://matt.sh/apfs-object-map-free-recovery