Capacitor V5 Filesystem not working on Android 12+

Since I updated my app to Capacitor v5.0.0 users on Android 12+ can no longer download some excel documents I have in the app. An error is thrown saying “Unable to do file operation, user denied permission request”

No matter what directory I send the file to I get the same issue. It was previously working on Capacitor v4. I also have updated to the latest v5.0.4 and still the same issue.

Here is the code where it fails

 await Filesystem.writeFile({
                        path: `Download/${url.pathname
                          .replace('.xlsx', `${uuid()}.xlsx`)}`,
                        directory: Directory.ExternalStorage,
                        data: await blobToBase64(blob),