The background program for exporting - qmelt - sometimes crashes when cleaning itself up. It is not really necessary for a program to clean up after itself in the case of open files or memory. The operating system will take care if it. Temporary files is another matter, but the background export program qmelt rarely does this (on the other hand, Shotcut does). In any case, we do tell qmelt not to bother trying to clean up, but it is inevitable that some things will that are more difficult to command in software internals.
If you get a failure like this near the end, open the file in Shotcut. If it opens, go to Properties > menu > Start Integrity Check Job. Next, see the Jobs panel. If the Job fails, double-click it to view the log and see errors.