This error is usually caused by a blocked connection. Please make sure that all necessary Titanfall router ports are open and try to power-cycle your router. To do so, unplug your router from the power-source for at least 30 seconds and plug it back to your power connector again. Please keep in mind that especially VPN software can block your game from properly connecting to the server.
It's not about IP's, it's about TCP and UDP ports. Here is an article about that:
Some poviders are blocking them.
This worked for me!