One way to debug the issue is to put a breakpoint in the link-down event in the working code and analyze what triggers the link-down while you unplug the cable.
Thank you for your reply.
I can’t put a breakpoint in RL-TCPnet library because it comes as a compiled LIB file