Seems to be specific to more recent versions of iOS (and maybe macOS?). My iPad was working fine with 15.4 but after I updated to 17.5.1 a three-file upload failed after the second with the following error:
/var/www/discourse/lib/discourse.rb:138:in `exec':
Doesn’t seem to be browser-specific.
Other users are reporting timeouts, none mentioned error messages so far.