I had a very similar issue with nginx proxy manager.
after hours of debugging decided to see if this issue could be related to the nginx/proxy manager itself.
I switched to Caddy and everything worked without any issue.
so I guess it was related somehow to NPM.