So I'm losing faith right now because I'm having the same problem that you have randomly works and then it doesn't, and the things I did well
I reinstalled windows
Went to my router and added the ports to the port forwarding UDP and TCP
I added the ports also in firewall
I tried disabling all firewalls and the only one enabled is Warframe
I tried disabling the whole firewall service
I tried reinstalling the game
I tried VPN
I tried enabling DMZ in my router
I tried enabling UPNP in my router
changing my ethernet cable (don't know why but I did that )
trying to fix this issue till this day but no hope at all