Description
If an examiner by mistake grants more than one new attempt and then provides feedback, the student group is stranded at waiting for feedback on the last attempt given after the deadline expires while the examiner is prevented from given further feedback since «Feedback is already published!».
My guess is that the first feedback provided is given to the oldest open attempt, but that the save_object() if-else looks at something else.
Workaround
Using Simple bulk feedback an examiner is able to give the student group a grade, and that will also change the status from Waiting for feedback to Corrected.