git clone fails with error: connect ECONNREFUSED 127.0.0.1:80

I’m using isomorphic-git for a project, and when attempting to use git.clone I get the error Error: connect ECONNREFUSED 127.0.0.1:80.

This is a simple reproduction of what I’m trying to do:

import * as git from 'isomorphic-git';
import * as fs from 'fs';
import * as http from 'http';
const git_options = {
    fs,
    http,
    dir: config.git_dir, //yes this is defined
};

const remote_repo = 'dr-vortex/blankstorm';

await git.clone({ ...git_options, url: `https://github.com/${remote_repo}.git` });

I’ve seen this question using canonical git and checked the config with isomorphic-git and none of the values are set.

After navigating to the repository destination I found a complete git repository without a working tree. Doing a git pull fixes everything.

I also tried setting the ref option on the config (in case it was trying to pull the non-existant master branch, since I use main)

Is there a way to fix the error so that a git pull is not necessary?