Snapcraft review fails, wrong permissions?! electron-builder

I built using the latest electron-builder and during upload I get this error from the review.
The error states that the guid flag is set for some directories.

After some back and forth I unsquashed the .snap, removed gid permissions and repacked it.
Then the review succeeded. Has anyone an idea where the template originates from? (So it can be fixed for everyone)

sudo unsquashfs *.snap
sudo chmod -R g-s .
sudo snapcraft pack squashfs-root 

Using sudo to explicitly unsquash the files with permissions still intact.


Error while processing…
The store was unable to accept this snap.
- checksums do not match. Please ensure the snap is created with either 'snapcraft pack ’ (using snapcraft >= 2.38) or ‘mksquashfs -noappend -comp xz -all-root -no-xattrs -no-fragments’. If using electron-builder, please upgrade to latest stable (>= 20.14.7). See Automated reviews and snapcraft < 2.38 for details.
- found errors in file output: unusual mode ‘rwxrwsr-x’ for entry ‘./locales’, unable to read or access files in ‘squashfs-root/meta’ due to mode ‘rwxrwsr-x’, unusual mode ‘rwxrwsr-x’ for entry ‘./meta/gui’, unusual mode ‘rwxrwsr-x’ for entry ‘./resources’, unusual mode ‘rwxrwsr-x’ for entry ‘./swiftshader’

I thought that snapcraft stripped these bits sometime before the ‘pack’ stage. Perhaps @sergiusens can comment? (IMO the ‘pack’ stage correctly does not strip these bits; it should happen earlier)