I've found an inconsistency at the assignment plugin.
If a teacher changes the group of a student, which did a submission on a group assignment earlier. Than the student, which did the submission, can't view the assignment anymore and gets a "nopermissiontocomment" exception (with half of the side loaded).
It was a struggle to find that error, since we got only the report of a trainer saying, that the assignment can't be viewed by some students. And therefore I don't think there is an easy fix for this.
Edit: I can give this additional information as well. It may lead to a solution of this issue, but it's hard to decide, which direction this should go. I don't know that for sure, but it seems reasonable for me, that, if it is a group assignment and somebody has submited a solution, there will be created 2 entries in the assign_submission table. One for the student and one for the group. If the group of the student is changed both entries are untouched, which results in status "submitted for grading" for the user and "no submission" for the group in which he's moved. This conflict is badly resolved by moodle and gives the mistakable error message "nopermissiontocomment", which is thrown by line 61 of /mod/assign/submission/comments/lib.php as an result of assignsubmission_comments_comment_validate() in line 33 of the same file.
Assume a changed group after a successful submission of a student, called "the student".
In our case $group will be the new one, in which the student was moved and $submission->groupid will be the old one, in which he submitted his solution. Therefore, $groupid wont be same as $submission->groupid.
The reason, why moodle evaluates this statement at all is located at line 640 of /mod/assign/renderer.php. it says:
Conclusion: Team has no submission, but the student has this entry from earlier, which leads to true for him, but false for all other group members. After that there is a series of renderer called which leads to the the if-statement mentioned above and to the exception.
Edit: The whole backtrace is: