Are you saying you use a mobile hotspot and it works but not on the main router.
It is extremely common to get huge lag spikes on wifi. That is why you see everyone recommend you do not use wifi for online games.
If it works on one wifi connection and not others it could be running on a different radio channel or the devices are in different rooms and the signal is getting different interference from outside. It is the interference likely form a neighbor using wifi that is likely causing the spikes.