The problem is that in order to use the gallery field the user has to have access to the media library. Any user type that does not have access to editing the media library will cause a JS error.
I think this means that the user must be at least a contributor, maybe an author.