Failed to make a request from docker to the host machine

I need to make a request from a docker container to the host machine.

Example request look like this:

/ # apk add curl
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/aarch64/APKINDEX.tar.gz
(1/10) Installing ca-certificates (20240226-r0)
(2/10) Installing brotli-libs (1.1.0-r2)
(3/10) Installing c-ares (1.28.1-r0)
(4/10) Installing libunistring (1.2-r0)
(5/10) Installing libidn2 (2.3.7-r0)
(6/10) Installing nghttp2-libs (1.62.1-r0)
(7/10) Installing libpsl (0.21.5-r1)
(8/10) Installing zstd-libs (1.5.6-r0)
(9/10) Installing libcurl (8.8.0-r0)
(10/10) Installing curl (8.8.0-r0)
Executing busybox-1.36.1-r29.trigger
Executing ca-certificates-20240226-r0.trigger
OK: 14 MiB in 24 packages
/ # curl http://host.docker.internal:3000
curl: (7) Failed to connect to host.docker.internal port 3000 after 3 ms: Couldn't connect to server
/ # 

In the browser http://host.docker.internal:3000 opens normally. Why does this happen and how to avoid it?

PS:

OS: macOS Sonoma

/etc/hosts:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1 		localhost
255.255.255.255	broadcasthost
::1             localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1		kubernetes.docker.internal
127.0.0.1		host.docker.internal
::1				host.docker.internal
# End of section

127.0.0.1 inside a Docker container is the internal localhost, not 127.0.0.1 from the host.