Devilbox php-fpm in Windows with WSL2 cannot resolve apt repositories

I saw this after modifying the php-startup-7.3 folder for running apt update:

php_1    | [INFO] Executing custom startup script: 01-apt-update.sh
php_1    | Err:1 http://security.debian.org/debian-security buster/updates InRelease
php_1    |   Could not resolve 'security.debian.org'
php_1    | Err:2 http://ppa.launchpad.net/git-core/ppa/ubuntu artful InRelease
php_1    |   Could not resolve 'ppa.launchpad.net'
php_1    | Err:3 http://dl.yarnpkg.com/debian stable InRelease
php_1    |   Could not resolve 'dl.yarnpkg.com'
php_1    | Err:4 http://apt.postgresql.org/pub/repos/apt stretch-pgdg InRelease
php_1    |   Could not resolve 'apt.postgresql.org'
php_1    | Err:5 http://ftp.debian.org/debian stretch-backports InRelease
php_1    |   Could not resolve 'ftp.debian.org'
php_1    | Err:6 http://packages.blackfire.io/debian any InRelease
php_1    |   Could not resolve 'packages.blackfire.io'
php_1    | Err:7 http://deb.debian.org/debian buster InRelease
php_1    |   Could not resolve 'deb.debian.org'
php_1    | Err:8 http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 InRelease
php_1    |   Could not resolve 'repo.mongodb.org'
php_1    | Err:9 http://deb.debian.org/debian buster-updates InRelease
php_1    |   Could not resolve 'deb.debian.org'
php_1    | Reading package lists...
php_1    | W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Could not resolve 'deb.debian.org'
php_1    | W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Could not resolve 'security.debian.org'
php_1    | W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Could not resolve 'deb.debian.org'
php_1    | W: Failed to fetch http://ftp.debian.org/debian/dists/stretch-backports/InRelease  Could not resolve 'ftp.debian.org'
php_1    | W: Failed to fetch http://packages.blackfire.io/debian/dists/any/InRelease  Could not resolve 'packages.blackfire.io'
php_1    | W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/artful/InRelease  Could not resolve 'ppa.launchpad.net'
php_1    | W: Failed to fetch http://repo.mongodb.org/apt/debian/dists/stretch/mongodb-org/4.0/InRelease  Could not resolve 'repo.mongodb.org'
php_1    | W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/stretch-pgdg/InRelease  Could not resolve 'apt.postgresql.org'
php_1    | W: Failed to fetch http://dl.yarnpkg.com/debian/dists/stable/InRelease  Could not resolve 'dl.yarnpkg.com'
php_1    | W: Some index files failed to download. They have been ignored, or old ones used instead.

The same happens if I add a line to that file, say, apt install php-mailparse
I don’t think adding another extension to the php-fpm container is necessary for this to work; the whole idea of a php-startup folder and its related files is to do custom setups without changing the image itself. Has anyone come across this?
The only thing I can think of is that to make DNS work for Devilbox I had to add the localhost DNS to the vEthernet (WSL) adapter running my wsl2 instance. Without that change, automatic DNS fails in Docker for Windows using WSL2.
I also tried running apt update from within the php-fpm container and the result is the same, no resolution.

Update:
I removed the localhost entry in the WSL network adapter to see if it’s the culprit, but no, the behavior is the same. I’m starting to think this should be a bug instead of posting here…