It seems you are not the first person to report this.
According to that, the issue is triggered specifically by using "Save changes" and the first save works, but usually the second (or one soon afterwards) fails, as will many other menu items after the first save. It seems no one managed to find the bug and fix it since those reports.
I was curious and took a look. There is a mention in webwork2/lib/WeBWorK/Authen/Shibboleth.pm that the Shibboleth for WW does not use cookies, so maybe the reason this fails only for people using Shibboleth is that related to the fact that the renewed authentication/authorization must occur without a cookie, and for some reason clicking "Save changes" in the set editor causes this to fail.
One thing to try is to use developer mode in the browser to see (and the save) all the header and form data from the first time "Save Changes" is clicked, and then from the second time. Differences between what appears in the 2 request to the server may provide a hint as to what is really happening. (Are some form fields disappearing, are some header lines disappearing?)
Here is a somewhat wild conjecture. It could be that some critical "form fields" which need to be kept in the HTML form are being cleared and this is triggering the authentication failure. The reason I suspect that this might be a possible explanation is noticing the code
in webwork2/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail2.pm below the comment about "reset all the parameters dealing with set/problem/header information" (about line 1861, but the line number may vary depending on your version of WW).
foreach my $param ($r->param) {
$r->param($param, "") if $param =~ /^(set|problem|header)\./ && $param !~ /displaymode/;
}
If for some reason WW is storing some data in a form field used somehow by the WW+Shibboleth authentication and which is accidentally cleared there - that would explain the error. However, I do not see anything in the WW code which seems to set a form field of a name which would be cleared here and which could be related to authentication.