Iphone changes latency

as soon as the headphones are changed (unplugged and plugged back in), the latency changes. Tested on various iPhones. Connection in the local network. process can be repeated without any problems. If the PC client is reconnected, the latency is back to normal. I urgently need help. Thanks