This seems to be due to chaining from npm
into node
executables which are causing interactions with confinement (even though both are classic, and within the same snap).
The first exec succeeds and restores the right working directory though:
DEBUG: execv(/snap/snapd/16292/usr/lib/snapd/snap-exec, /snap/snapd/16292/usr/lib/snapd/snap-exec...)
DEBUG: argv[1] = node.npm
DEBUG: argv[2] = install
While the second exec call with these arguments is the one that is failing to have the working directory restored:
DEBUG: execv(/snap/snapd/16292/usr/lib/snapd/snap-exec, /snap/snapd/16292/usr/lib/snapd/snap-exec...)
DEBUG: argv[1] = node
DEBUG: argv[2] = /snap/node/6512/bin/npm
DEBUG: argv[3] = install