However, when I trigger the script from my WordPress server to populate the database, I’m hitting a connection timeout, possibly due to the PHP-to-Node setup or Atlas configuration.
This sounds very much like the IP Access List is not correctly configured, which is a likely failure reason when the code works fine from one machine, but fails from another.
If you don’t mind, I am a little surprised at your setup. You are running PHP, and from the output you posted it looks like you installed the MongoDB extension (ext-mongodb). All of the access to MongoDB however is done from a node.js script called through exec - why not load data using the PHP driver instead of using exec to call into a node script?