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.