After upgrading to Moodle 3.9.6 we found that student users who use the "remove submission" option in the mod/assign plugin get a confusing situation. The file gets removed, but the submission status stays the same (assignment submitted). This creates the situation of "ghost" assignments where the teacher sees a submission, without any file to grade.
Before, a user could edit their submission and remove any unwanted files. This seems to have changed to where this is (again) no longer possible and the option to "remove submission" has replaced this functionality. Users who try to remove the submission via "edit submission" get an error message stating "nothing was submitted". A problem which persisted from 3.4 onward and was fixed in an earlier 3.9 build. Now the "remove submission" has taken it's place we again get an issue where students can't edit their submissions when they have, for example, sent in a file for the wrong assignment.
Here you can see a reproduction with a teststudent. The site is in dutch, but the submission status reads "File submitted" and you can see the teststudent doesn't have any files actually submitted. It seems the submission status does not get reset after removal of the submitted file.
Does anyone have any idea how to fix this?