Motor - Machine Actively Refusing Connect

I modified the code not to utilize anything except to print the value since the printed values would’ve been usernames and passwords, so I had to modify them before printing them.

Output of the following standalone:

print(db_info['username'], db_info['password'], ssh_info['username'], ssh_info['password'])
admin p@ssw0rd admin p@ssw0rd

Output from the same code being run on the discord bot:

admin p@ssw0rd admin p@ssw0rd

I did try to run the following on the Pi

sudo ufw allow from trusted_server_ip to any port 27017
sudo ufw enable (or start forget which)

Where the trusted server IP is the PC IP (public IP) in hopes it was genuinely refusing a connection