I would assume this change fixes the issue. In theory it should still work even without this change and it usually does (cause it would use the first siteId within the list). It would be interesting to see what the
access table on this instance looks like.
Update: I can think of an error when idSite 1 was deleted see https://3v4l.org/gEvUb
So this change likely fixes it.