I have had the same problem for months until I finally figured out that the problem was happening because I had a double NAT.
To fix it I went to the GUI of my ISP(Internet Service Provider) and forwarded the ports there. I then went to file explorer of the device that I was trying to host from, then network, then under network infrastructure I right clicked on my router, then clicked properties, then settings, and then made the port rules there too (3074 UDP, and 4976 UDP).
From what I'm understanding making the port rule in the GUI of your ISP opens the port for the modem and not the router, so the connection essentially goes through the modem and stops at the router.
Making the port rule for your router inside of windows seems to eliminates this issue, at least it did for me. I now have an open NAT type and friends can join with no issues.
There are also a few other ways of eliminating a double NAT, but a double NAT is likely what is causing the issue.