Error 6 when building on linux

Some progress. I have tried to manually build the app from source, works. fine. Tried with release-1.2.6, pre-release 1.3.9 and dev. The problem seems to occur after this command:

$ npm run dist

None of the binaries (even unpacked) works after that command. All leading to the white frame without any response. I can reproduce this across various version.

Oh, and if I run it as a flatpak, it works.

Unfortunately, my foo with the node ecosystem is too weak to come to some conclusion.

Works:

$ npm install --cache ./npm-cache
$ cd ElectronClient
$ npm install --cache ./npm-cache
$ npm start

Doesn't work:

$ npm install --cache ./npm-cache
$ cd ElectronClient
$ npm install --cache ./npm-cache
$ npm run dist
$ cd dist 
$ chmod +x Joplin-x.x.x.AppImage
$ ./Joplin-x.x.x.AppImage

Unfortunately I currently do not have a Linux machine to run any tests.