Database entries for group submissions do not seem to have the latest flag correctly set.
Instead it seems like the flag is always set on the first attempt.
This leads to functions using said bit to not get the latest attempt.
Also see https://tracker.moodle.org/browse/MDL-70110?focusedCommentId=824569&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-824569 for an excerpt from the database. That issues setup part of the testing instructions can also be expanded by submitting another attempt after grading the first to get the desired database state.
While the function in the linked issue does not currently use the latest flag it could also be simplified to use it.
Update: When the attempt is reopened the latest flag (assign_submission) will be updated for each user in the group, but the group entry (with an id of 0) will not.