It is for air gap environment where internet will not be there.
So all the rpm packages are locally downloaded and the it will be installed through dnf localinstall *.rpm
As the repo were enabled so it is redirecting to mirror lists and as network was not there it is throwing error.
So disabled the repo and then it didn’t go to mirror list
You could use createrepo_c to generate repo metadata from those packages.
Then define a repo (in /etc/yum.repos.d/) that points to your local repository path.
As I said earlier, the dnf localinstall *.rpm is exactly same as dnf install *.rpm
and dnf --disablerepo=* install *.rpm is ad hoc “install without repos”, while dnf config-manager --disable baseos appstream extras disables those three repos.