I would take Unifi Pro out of the picture in your problem description unless you meant to say the issue happens over wireless link.
When the issue happens next time, plug a PC throught UTP cable into one of the ports that you configured as part of the switch in ER-X. Then try to ping an external host. If it doesn't work, very likely an issue between your ISP and ER-X. If ping works, then move to next.
Now, switch your laptop to WiFi in which your laptop connects to ER-X through Unifi Pro. Ping the same external host. If it doesn't work (most likely), it's an issue between ER-X and Unifi Pro. I'm pretty sure many Unifi users in the other sub-forums can help you further from there on.