In VPN network, TA gateway tried to register extension from S-Series PBX, SIP trunk status in gateway is unreachable intermittently.
PCAP file captured from gateway, it could see TA kept sending REGISTER packet to PBX with it's IP 192.168.0.98.
PCAP file captured from PBX, it could see TA's IP was 192.168.16.254 thus PBX will reply 401 authentication back to the IP address while it's not TA's original address so gateway didn't receive it. Obviously the TA gateway's IP was changed by router that connected to PBX.
Disable the SIP AlG option on the router. If it didn't help, have to check problem with router manufacturer.