I had the same issue. Deleted the Android and Lost. Dir folders from the sd card rebooted and haven't had the issue since. Just go to my files and on ur external sd card there will be a folder called Android just delete it. Your system will generate a new one when you reboot. May be the Android folder from our previous phones causes some compatibility issue.
Just an update on this. Deleting the android folder just provided a placebo effect. It didnt really help, the error was back after a few hours. The only thing i could do is back up the data and format the sd card. Quite a few images on my sd card were corrupt. Might be worth a try if you're facing the issue though.
I know you already found your solution, but for others that come looking, wiping the device cache fixed it for me.
Hold Bixby & Volume up, then power.
Release when the android/samsung screen comes up
Choose "wipe device cache"
Choose "reboot your device"