I’m pretty sure the file you are seeing was manually copied/uploaded and decompressed at that location. Backups use /var/www/discourse/tmp/backups/<name>/<timestamp> for storing the temporary dump.sql.gz file und restoring uses a completely different directory.
We are calling pg_dump with the --compress parameter, so it writes a compressed dump without a temporary file. Worst case, you’d see an incomplete dump.sql.gz file.