Some plugins have implemented their own file serving, which breaks when its an ajax script.
presigned_url_should_redirect_file should return false if it detects AJAX_SCRIPT because core checks this:
lib/weblib.php-2078-function redirect($url, $message='', $delay=null, $messagetype = \core\output\notification::NOTIFY_INFO): Never {
lib/weblib.php-2079- global $OUTPUT, $PAGE, $CFG;
lib/weblib.php-2080-
lib/weblib.php-2081- if (CLI_SCRIPT or AJAX_SCRIPT) {
lib/weblib.php-2082- // This is wrong - developers should not use redirect in these scripts but it should not be very likely.
lib/weblib.php:2083: throw new moodle_exception('redirecterrordetected', 'error');
lib/weblib.php-2084- }