Why do LedgerJS and Electrum, using the same Nano S and derivation path, not refer to the same Wallet?
A public key can have multiple addresses. It looks like what is happening here is that Electrum is creating a P2SH-P2WPKH type address while your NodeJS code is creating a P2PKH address. These are two different address types which have different spending requirements and transaction data. However Bitcoin sent to either address type can still be spent with the same private key and the same public key was used to create both addresses.

When you sent the Bitcoin to the P2PKH address, Electrum won't show it because it is not looking for Bitcoin sent to that address. Just because you have the private key necessary to spend some Bitcoin does not necessarily mean that your wallet will be looking for outputs of that kind. A wallet cannot track all possible output scripts that it can spend (it is infinite), it can only track the ones it is expecting to see. So for Electrum, it's only tracking the P2SH-P2WPKH address and not the P2PKH address that you sent Bitcoin to.