Please make sure external sd has write permission.
A simple way to check, use a terminal app:
cd /storage/YOUR SD CARD NAME
If it says Permission Denied, means you need to make external sdcard writable.
You can try a magisk module called Extsdcard Write Access Enabler (but it is no effect on my phone with Android Oreo)
Finally I use a app called App2SD, it has a feature SD Fix, that can fix write permission for external sdcard, but I not sure it work with Android Pie.
And also, you can try to point your external sdcard at /mnt/media_rw/, maybe that location has write permission, but you maybe still need that magisk module.